Commit Graph

2408 Commits

Author SHA1 Message Date
Peter Bhat Harkins 179d566999
create SECURITY.md (#1107) 2022-07-08 13:37:52 +00:00
Thomas Dziedzic 7a5fe3d7a9
Update to Rails 7.0 (#1100) 2022-07-06 14:01:46 +00:00
Peter Bhat Harkins 48b23c148e fix voting/flagging from a7299e84
If the Lobster replacement class isn't in the global scope, the existing
Lobsters can't refer to it. But if it's in the global scope, the DOM isn't yet
loaded for it to read the current username. When the old class is entirely
replaced, insantiation of the class can move back into onPageLoad().
2022-06-29 09:18:13 -05:00
Peter Bhat Harkins 4c3c17710b tidy - separate js from ruby 2022-06-29 08:36:56 -05:00
Peter Bhat Harkins 488ad34995
Replacing 7 functions to further the removal of jQuery (#554) 2022-06-29 13:33:22 +00:00
William Karsten a7299e84fc Correct user assignment 2022-06-29 08:30:00 -05:00
Peter Bhat Harkins bbd4887b93 bring username out of script tag for #554 2022-06-29 07:47:48 -05:00
William Karsten 40f869e7c3 Clean up comments 2022-06-24 14:34:44 -05:00
William Karsten 483e5fe55f Updates vote() to remove the jQuery, I will revisit to break up into storyVote & commentVote 2022-06-24 12:40:42 -05:00
William Karsten c4589c5add Remove a stray script tag with jQuery, other changes already do that function 2022-06-24 12:22:26 -05:00
William Karsten 1fe8f099d3 Update saveStory() to remove the jQuery 2022-06-23 14:05:58 -05:00
William Karsten 39f25de9b4 Update hideStory() to remove the jQuery 2022-06-23 13:47:47 -05:00
William Karsten 3305e7f703 Minor non-function code chages for setup and notes 2022-06-23 12:39:21 -05:00
William Karsten 296d3feb39 Make a partial removal of jQuery from checkStoryTitle due to select2 2022-06-23 11:27:37 -05:00
William Karsten cc208ff195 Replace jQuery slidedown() function 2022-06-22 17:04:06 -05:00
Peter Bhat Harkins 44c89a5e62 permit up arrow for knuth notation 2022-06-22 08:54:03 -05:00
William Karsten e40c931cf7 Update bounceToLogin() to remove the jQuery 2022-06-21 16:24:44 -05:00
William Karsten 1d3dfdce2f Update checkStoryDuplicate() to remove the jQuery 2022-06-21 16:08:15 -05:00
William Karsten f0cc31d089 Reimplements the ctrl-enter comment submit bug fix 2022-06-21 13:47:32 -05:00
William Karsten 2ea18cdc92 Replace a onblur with a focusout that was missed, it had the 'change' so there was no bug 2022-06-21 11:56:05 -05:00
William Karsten e76e005b6f Add autosize to the comment editor 2022-06-21 11:36:41 -05:00
William Karsten 0571dc4f8a Update previewComment() to remove the jQuery 2022-06-21 11:24:55 -05:00
Peter Bhat Harkins 7d6f361349
jQuery removal: title checking, class setup (#554, PR #1098) 2022-06-20 14:01:40 +00:00
William Karsten 8c44943a90 Update Autosize 2022-06-17 20:34:38 -05:00
William Karsten 0f5a0a6e20 Fix a bug I put into post comment on update, and cleans up whitespace & comments 2022-06-17 15:42:10 -05:00
William Karsten 6308a671d7 Update the postComment function to remove the jquery. 2022-06-17 12:11:57 -05:00
William Karsten 32baaf0aea Set up _LobstersFunction to replace the _Lobsters class 2022-06-17 10:43:52 -05:00
William Karsten 6a9d8f1a3f Update the function for the user homepage input in account settings to remove jQuery 2022-06-17 10:23:30 -05:00
William Karsten 456b8d5c41 Updated the checkStoryTitle on document.ready function to remove the jQuery 2022-06-17 10:23:30 -05:00
William Karsten 7d20a8d6e2 Update the checkStoryTitle trigger to remove the jQuery, and labled a bug 2022-06-17 10:23:30 -05:00
Peter Bhat Harkins 7b8f55b40d
Continue removing jQuery (#554, PR #1096) 2022-06-17 13:08:22 +00:00
Peter Bhat Harkins c5f9e91e6e
whitespace 2022-06-17 13:06:46 +00:00
William Karsten 2776174695 Refactor the removeExtraInputs so it will never be an error and will only be called in one location. 2022-06-15 11:43:58 -05:00
William Karsten f29ba4d1a5 Refactor the inbox hat_id function to drop the index call 2022-06-15 10:34:27 -05:00
William Karsten 274c253f37 Resolve the overwriting headers bug I introduced 2022-06-15 09:26:38 -05:00
William Karsten d3358e5406 Update the comment delete function of the moderator to remove jQuery 2022-06-10 10:56:08 -05:00
William Karsten c5e44bbe25 Update the comment undeletor to remove jQuery, and minor style changes 2022-06-09 15:56:21 -05:00
William Karsten db34fa723a Add a function to solve the extra input bug when manipulating comments 2022-06-09 15:24:28 -05:00
William Karsten 1d02c1b316 Update the inbox mod-hat auto checkbox function to remove jquery. 2022-06-09 13:53:52 -05:00
William Karsten baac94b8dd Update the delete comment button to remove jQuery, and add a function to insert CSRF Tokens 2022-06-09 11:09:56 -05:00
Peter Bhat Harkins c475326c39 perf attempt: refactor to remove dependent subquery
old Story.filter_tags([1, 2, 3]):
Story.where.not( Tagging.select('TRUE').where('taggings.story_id = stories.id').where(tag_id: [1, 2, 3]).arel.exists)
SELECT `stories`.* FROM `stories` WHERE NOT (EXISTS (SELECT TRUE FROM `taggings` WHERE (taggings.story_id = stories.id) AND `taggings`.`tag_id` IN (1, 2, 3)))

new Story.filter_tags([1, 2, 3]):
Story.where(Story.arel_table[:id].not_in(Tagging.where(tag_id: [1, 2, 3]).select(:story_id).arel))
  SELECT `stories`.* FROM `stories` WHERE `stories`.`id` NOT IN (SELECT `taggings`.`story_id` FROM `taggings` WHERE `taggings`.`tag_id` IN (1, 2, 3))

same story for Story.filter_tags_for(1):
Story.where(Story.arel_table[:id].not_in(Tagging.joins(tag: :tag_filters).where(tag_filters: { user_id: 1 }).select(:story_id).arel))
  SELECT `stories`.* FROM `stories` WHERE `stories`.`id` NOT IN (SELECT `taggings`.`story_id` FROM `taggings` INNER JOIN `tags` ON `tags`.`id` = `taggings`.`tag_id` INNER JOIN `tag_filters` ON `tag_filters`.`tag_id` = `tags`.`id` WHERE `tag_filters`.`user_id` = 78)

So this is a clear improvement... but the EXPLAIN is exactly the same, MariaDB
recognized the opportunity:
+------+--------------+----------+-------+------------------------------------+-----------------+---------+------+-------+--------------------------+
| id   | select_type  | table    | type  | possible_keys                      | key             | key_len | ref  | rows  | Extra                    |
+------+--------------+----------+-------+------------------------------------+-----------------+---------+------+-------+--------------------------+
|    1 | PRIMARY      | stories  | ALL   | NULL                               | NULL            | NULL    | NULL | 85056 | Using where              |
|    2 | MATERIALIZED | taggings | index | story_id_tag_id,taggings_tag_id_fk | story_id_tag_id | 16      | NULL | 1     | Using where; Using index |
+------+--------------+----------+-------+------------------------------------+-----------------+---------+------+-------+--------------------------+

So this is a no-op on MariaDB, but I'm making the change because the
ActiveRecord is easier to read. Credit to Aaron Francis and Colleen Schnettler.
2022-06-08 08:18:11 -05:00
Peter Bhat Harkins 79456e0880
Begin removing jQuery (#554, PR #1095) 2022-06-08 11:33:46 +00:00
William Karsten 77df8b65e3 Updates the comment cancel button to remove jQuery 2022-06-07 16:39:04 -05:00
William Karsten 1ad1a4d6e2 Improve the replace function to iterate over childnodes, allowing it to handle multiple nodes 2022-06-07 11:52:16 -05:00
William Karsten d8fc4876e6 Make changes based on review notes. Also reordered a few functions to keep them together based on functionality 2022-06-06 12:54:30 -05:00
William Karsten a4143aec75 Convert comment editor button to remove jQuery, added replace function 2022-06-03 15:09:55 -05:00
William Karsten 2cd3c96b67 Convert story saver button to remove the jQuery 2022-06-03 11:46:13 -05:00
William Karsten 546cb7bfdb Convert the story hider button to remove jQuery 2022-06-03 11:46:13 -05:00
William Karsten 34f4998de8 on() bind multiple events 2022-06-03 11:46:13 -05:00
William Karsten 2b8c387cb1 CheckStoryTitle for separators after fetching 2022-06-03 11:46:13 -05:00