You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by ru...@apache.org on 2017/09/20 18:31:42 UTC

[whimsy] branch agenda_on_vue updated: cleanup: round 1; primarily replacing ~ with DOM calls

This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/agenda_on_vue by this push:
     new 0a52627  cleanup: round 1; primarily replacing ~ with DOM calls
0a52627 is described below

commit 0a52627b252318ec54459b140aac358230b6c34f
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Wed Sep 20 14:31:01 2017 -0400

    cleanup: round 1; primarily replacing ~ with DOM calls
---
 www/board/agenda/views/buttons/add-comment.js.rb     |  4 ++--
 www/board/agenda/views/buttons/add-minutes.js.rb     |  2 +-
 www/board/agenda/views/buttons/commit.js.rb          |  2 +-
 www/board/agenda/views/buttons/draft-minutes.js.rb   |  2 +-
 www/board/agenda/views/buttons/message.js.rb         |  2 +-
 www/board/agenda/views/buttons/post.js.rb            |  4 ++--
 www/board/agenda/views/buttons/publish-minutes.js.rb |  2 +-
 www/board/agenda/views/layout/header.js.rb           | 10 +++-------
 www/board/agenda/views/pages/roll-call.js.rb         | 12 ++++++------
 9 files changed, 18 insertions(+), 22 deletions(-)

diff --git a/www/board/agenda/views/buttons/add-comment.js.rb b/www/board/agenda/views/buttons/add-comment.js.rb
index fe54301..398b1f7 100644
--- a/www/board/agenda/views/buttons/add-comment.js.rb
+++ b/www/board/agenda/views/buttons/add-comment.js.rb
@@ -64,7 +64,7 @@ class AddComment < Vue
   # autofocus on comment text
   def mounted()
     jQuery('#comment-form').on 'shown.bs.modal' do
-      ~'#comment-text'.focus()
+      document.getElementById("comment-text").focus()
     end
   end
 
@@ -75,7 +75,7 @@ class AddComment < Vue
 
   # when save button is pushed, post comment and dismiss modal when complete
   def save(event)
-    Server.initials = ~'#comment_initials'.value
+    Server.initials = document.getElementById("comment-initials").value
 
     data = {
       agenda: Agenda.file,
diff --git a/www/board/agenda/views/buttons/add-minutes.js.rb b/www/board/agenda/views/buttons/add-minutes.js.rb
index a462791..c0f0410 100644
--- a/www/board/agenda/views/buttons/add-minutes.js.rb
+++ b/www/board/agenda/views/buttons/add-minutes.js.rb
@@ -70,7 +70,7 @@ class AddMinutes < Vue
   # autofocus on minute text
   def mounted()
     jQuery('#minute-form').on 'shown.bs.modal' do
-      ~'#minute-text'.focus()
+      document.getElementById("minute-text").focus()
     end
   end
 
diff --git a/www/board/agenda/views/buttons/commit.js.rb b/www/board/agenda/views/buttons/commit.js.rb
index 9f9d237..0a23d78 100644
--- a/www/board/agenda/views/buttons/commit.js.rb
+++ b/www/board/agenda/views/buttons/commit.js.rb
@@ -37,7 +37,7 @@ class Commit < Vue
   # autofocus on comment text
   def mounted()
     jQuery('#commit-form').on 'shown.bs.modal' do
-      ~'#commit-text'.focus()
+      document.getElementById("commit-text").focus()
     end
   end
 
diff --git a/www/board/agenda/views/buttons/draft-minutes.js.rb b/www/board/agenda/views/buttons/draft-minutes.js.rb
index 2b506b1..0181ef4 100644
--- a/www/board/agenda/views/buttons/draft-minutes.js.rb
+++ b/www/board/agenda/views/buttons/draft-minutes.js.rb
@@ -33,7 +33,7 @@ class DraftMinutes < Vue
     @draft = ''
     jQuery('#draft-minute-form').on 'shown.bs.modal' do
       retrieve "draft/#{Agenda.title.gsub('-', '_')}", :text do |draft|
-        ~'#draft-minute-text'.focus()
+        document.getElementById("draft-minute-text").focus()
         @disabled = false
         @draft = draft
         jQuery('#draft-minute-text').animate(scrollTop: 0)
diff --git a/www/board/agenda/views/buttons/message.js.rb b/www/board/agenda/views/buttons/message.js.rb
index fc0d3bb..51a509d 100644
--- a/www/board/agenda/views/buttons/message.js.rb
+++ b/www/board/agenda/views/buttons/message.js.rb
@@ -16,7 +16,7 @@ class Message < Vue
 
   # autofocus on the chat message when the page is initially displayed
   def componentDidMount()
-    ~'#chatMessage'.focus()
+    document.getElementById("chatMessage").focus()
   end
 
   # send message to server
diff --git a/www/board/agenda/views/buttons/post.js.rb b/www/board/agenda/views/buttons/post.js.rb
index c484af5..d5cef1d 100644
--- a/www/board/agenda/views/buttons/post.js.rb
+++ b/www/board/agenda/views/buttons/post.js.rb
@@ -66,9 +66,9 @@ class Post < Vue
   def mounted()
     jQuery('#post-report-form').on 'shown.bs.modal' do
       if @@button.text == 'add resolution'
-        ~'#post-report-title'.focus()
+        document.getElementById("post-report-title").focus()
       else
-        ~'#post-report-text'.focus()
+        document.getElementById("post-report-text").focus()
       end
     end
   end
diff --git a/www/board/agenda/views/buttons/publish-minutes.js.rb b/www/board/agenda/views/buttons/publish-minutes.js.rb
index cd1f4d5..f2cc153 100644
--- a/www/board/agenda/views/buttons/publish-minutes.js.rb
+++ b/www/board/agenda/views/buttons/publish-minutes.js.rb
@@ -53,7 +53,7 @@ class PublishMinutes < Vue
   # autofocus on minute text
   def mounted()
     jQuery('#publish-minutes-form').on 'shown.bs.modal' do
-      ~'#summary-text'.focus()
+      document.getElementById("summary-text").focus()
     end
   end
 
diff --git a/www/board/agenda/views/layout/header.js.rb b/www/board/agenda/views/layout/header.js.rb
index 7d80926..4c3e0fc 100644
--- a/www/board/agenda/views/layout/header.js.rb
+++ b/www/board/agenda/views/layout/header.js.rb
@@ -118,14 +118,9 @@ class Header < Vue
     end
   end
 
-  # set title on initial rendering
-  def componentDidMount()
-    self.componentDidUpdate()
-  end
-
   # update title to match the item title whenever page changes
-  def componentDidUpdate()
-    title = ~'title'
+  def mounted()
+    title = document.getElementsByTagName('title')[0]
     if title.textContent != @@item.title
       title.textContent = @@item.title
     end
@@ -134,5 +129,6 @@ class Header < Vue
   # toggle info dropdown
   def toggleInfo
     @infodropdown = (@infodropdown ? nil : 'open')
+    console.log 'toggle'
   end
 end
diff --git a/www/board/agenda/views/pages/roll-call.js.rb b/www/board/agenda/views/pages/roll-call.js.rb
index 376dcd2..1b5153a 100644
--- a/www/board/agenda/views/pages/roll-call.js.rb
+++ b/www/board/agenda/views/pages/roll-call.js.rb
@@ -121,9 +121,9 @@ class RollCall < Vue
   # scroll walkon input field towards the center of the screen
   def updated()
     if RollCall.lockFocus and @guest.length >= 3
-      walkon = ~'.walkon'
+      walkon = document.getElementsByClassName("walkon")[0]
       offset = walkon.offsetTop + walkon.offsetHeight/2 - window.innerHeight/2
-      jQuery('html, body').animate({scrollTop: offset}, :slow);
+      jQuery('html, body').animate({scrollTop: offset}, :slow)
     end
   end
 end
@@ -144,7 +144,7 @@ class Attendee < Vue
       @checked = status.present
       @notes = (status.notes ? status.notes.sub(' - ', '') : '')
     else
-      @checked = ''
+      @checked = false
       @notes = ''
     end
   end
@@ -154,7 +154,7 @@ class Attendee < Vue
   # forms.  CSS controls which version of the notes is actually displayed.
   def render
     _li onMouseOver: self.focus do
-      _input type: :checkbox, checked: @checked, onChange: self.click
+      _input type: :checkbox, checked: @checked, onClick: self.click
 
       roster = '/roster/committer/'
       if @@person.id
@@ -185,7 +185,7 @@ class Attendee < Vue
   end
 
   # initialize pending update status
-  def componentDidMount()
+  def mounted()
     self.pending = false
   end
 
@@ -204,7 +204,7 @@ class Attendee < Vue
   end
 
   # after display is updated, send any pending updates to the server
-  def componentDidUpdate()
+  def updated()
     return unless self.pending
 
     data = {

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <co...@whimsical.apache.org>'].