Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a live edit feature to the realtime compiler #1458

Merged
merged 72 commits into from
Nov 14, 2023
Merged
Changes from 1 commit
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
da1263a
Create LiveEditController.php
caendesilva Nov 13, 2023
0fc7311
Buffer page router contents
caendesilva Nov 7, 2023
3cde09a
Add configuration option for the live edit feature
caendesilva Nov 12, 2023
49bc7a5
Add enabled method
caendesilva Nov 13, 2023
766808b
Add new live edit API route to page router
caendesilva Nov 13, 2023
3feb14c
Authorize POST requests
caendesilva Nov 13, 2023
4972dae
Add expectsJson method to base controller
caendesilva Nov 13, 2023
2d6647e
Handle HttpExceptions
caendesilva Nov 13, 2023
69984c5
Merge branch 'master' into realtime-compiler-live-edit
caendesilva Nov 13, 2023
09e3620
Collect and validate required input
caendesilva Nov 13, 2023
b06340a
Get and validate the page
caendesilva Nov 13, 2023
e3923d5
Save the page Markdown
caendesilva Nov 13, 2023
7b7a1c9
Return with success response
caendesilva Nov 13, 2023
bfd3d3a
Scaffold live edit resource files
caendesilva Nov 13, 2023
083dd8d
Create accessor to get live edit resources
caendesilva Nov 13, 2023
3e4e39c
Merge branch 'master' into realtime-compiler-live-edit
caendesilva Nov 13, 2023
9166d4e
Update page router to inject live edit scripts when enabled
caendesilva Nov 13, 2023
6b42303
Add environment variable for the live edit feature
caendesilva Nov 13, 2023
54b7a4f
Create base live edit markup
caendesilva Nov 13, 2023
4e2bfaf
Simplify function signature
caendesilva Nov 13, 2023
ec4f02f
Render markdown into textarea
caendesilva Nov 13, 2023
42ae982
Create function to initialize live editor
caendesilva Nov 13, 2023
dd6ed11
Get the article element
caendesilva Nov 13, 2023
8eae7fd
Create base double click event listener function
caendesilva Nov 13, 2023
c569a19
Sketch out editor switching logic
caendesilva Nov 13, 2023
5fb295e
Flip if-else
caendesilva Nov 13, 2023
df568f6
Extract function
caendesilva Nov 13, 2023
7500b4d
Invert faulty boolean logic
caendesilva Nov 13, 2023
ca5f77d
Implement editor setup function
caendesilva Nov 13, 2023
293b2a9
Implement show editor function
caendesilva Nov 13, 2023
b86e715
Use helper function
caendesilva Nov 13, 2023
134931f
Create function to hide editor
caendesilva Nov 13, 2023
1792f8b
Add event listener to hide editor on cancel button click
caendesilva Nov 13, 2023
c90e82f
Use function name instead of closure wrapper
caendesilva Nov 13, 2023
394976e
Focus on the textarea
caendesilva Nov 14, 2023
16391d8
Add form identifier
caendesilva Nov 14, 2023
1beb4b6
Remove trailing parentheses
caendesilva Nov 14, 2023
79ea5e6
Add form submit event listener
caendesilva Nov 14, 2023
4bcb38e
Session must be started by static method
caendesilva Nov 14, 2023
7de722e
Add hidden token input
caendesilva Nov 14, 2023
cd3e45c
Add hidden path input
caendesilva Nov 14, 2023
06708d2
Change textarea identifier
caendesilva Nov 14, 2023
3f973d1
Implement form handler
caendesilva Nov 14, 2023
0bf73fa
Add todo
caendesilva Nov 14, 2023
99fdaa6
Swap declaration order
caendesilva Nov 14, 2023
35bb27a
Reassign editor after inserting node
caendesilva Nov 14, 2023
6b36a57
Apply CSS classes from article to editor
caendesilva Nov 14, 2023
d0e8a7e
Add CSS selector for page type
caendesilva Nov 14, 2023
d2f88d8
Revert "Add CSS selector for page type"
caendesilva Nov 14, 2023
1d0c6b8
Add prose class to header
caendesilva Nov 14, 2023
ba64ab4
Dynamic row count
caendesilva Nov 14, 2023
6d2d1bc
Revert "Dynamic row count"
caendesilva Nov 14, 2023
2849716
Style editor
caendesilva Nov 14, 2023
37b3645
Simplify input names
caendesilva Nov 14, 2023
576c69b
Simplify element selectors
caendesilva Nov 14, 2023
5038c12
Create live editor stylesheet
caendesilva Nov 14, 2023
0ff89ce
Add dynamic margins depending on page type
caendesilva Nov 14, 2023
f61e0f8
Change internal console context handling
caendesilva Nov 14, 2023
7bb0803
Write to console when updating page
caendesilva Nov 14, 2023
fca682a
Move function declarations to outer function scope
caendesilva Nov 14, 2023
cf9c92e
Add support for keyboard shortcuts
caendesilva Nov 14, 2023
d2595ea
Add local storage option to disable shortcuts
caendesilva Nov 14, 2023
ecaf1f5
Equalize header margins
caendesilva Nov 14, 2023
4411be9
Add markup for editor preferences button
caendesilva Nov 14, 2023
a27ee30
Send redirect response
caendesilva Nov 14, 2023
a407d2a
Replace custom form handler with browser form handling
caendesilva Nov 14, 2023
64b05e5
Extract helper method
caendesilva Nov 14, 2023
185e9ef
Formatting
caendesilva Nov 14, 2023
b065cb6
Match status message to code
caendesilva Nov 14, 2023
8ca06ba
Revert "Add markup for editor preferences button"
caendesilva Nov 14, 2023
ee6e9b7
Merge branch 'master' into realtime-compiler-live-edit
caendesilva Nov 14, 2023
c9f5321
Merge branch 'master' into realtime-compiler-live-edit
caendesilva Nov 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add local storage option to disable shortcuts
  • Loading branch information
caendesilva committed Nov 14, 2023
commit d2595eaacad7bd62c46a5748905e7d00be8099f9
2 changes: 1 addition & 1 deletion packages/realtime-compiler/resources/live-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function initLiveEdit() {
}

function shortcutsEnabled() {
return true; // Todo: Add option to disable all keyboard shortcuts
return localStorage.getItem('hydephp.live-edit.shortcuts') !== 'false';
}

const article = getArticle();
Expand Down