The first article builder page was an attempt at letting the user build an article using the entire page. This was to allow the user to have a Word-like or Google Docs-like experience. It didn't have a great UI and it would be difficult to add a html/css/javascript editor to the Lexical Editor while still keeping what we care most about the rich text editor - the ability of readers to highlight certain sections of the article and comment specifically on that section. The point of the first iteration of the article builder was to keep the toolbar in view at all times.
The second article builder was an attempt at letting the user create smaller sections of an article and then add, remove, and rearrange the sections with drag and drop functionality. I think this version works better at smaller screen sizes and it is what I will be copying with this third iteration of the article builder.
This article builder should look like the second version except instead of a add / remove button. Each "section" should have an add editor, add HTML/CSS/JavaScript, and remove section buttons.
The tabs for the HTML / CSS / JavaScript editor should be hidden when the editor is not focused. Listen for the focusin events.
When submitted, the lexical state for each lexical editor should be serialized to JSON and stored in an array and each html/css/js "Custom Code" section should be stored as html: string, css: string, javascript: string. See the object below
Since I am the only one using the article builder for now, I don't need to worry about sand-boxing the javascript. I just need to post the html / css / js to the server and get back the js with a nonce.
To include a Article Builder v3 and associated code on the page, include a form with the attribute data-article-builder-final .
There can only be one article builder v3 per page due to the fact the sort container must have the same id as all of the sections, and it is more trouble than its worth (probably) to make that work.
Are you sure you want to delete this article section? You can not undo this change.
Add a Comment
Annotate Article
Share Article
Successfully copied article URL to clipboard!
Something went wrong copying the article URL to the clipboard.
Successfully copied editor state to clipboard!
Successfully copied URL to clipboard!
Copied code to clipboard.
Copied TeX code to clipboard.
Uploaded file must be an image of type .jpeg, .jpg, .png, .webp, .gif, .bmp, or .svg.
Image Size must be less than 5MB.
Uploaded file must be an image of type jpeg, jpg, png, webp, avif, tiff, or svg.
Something went wrong uploading the image to the database. Try reloading the page.
The maximum number of images you can upload is 30.
There was an error taking an image using the device's camera. Try uploading an image instead.
Uploaded file must be an audio file.
Audio file must be an audio file of type .m4a, .flac, .mp3, .mp4, .wav, .wma, .aac, .webm, or .mpeg.
Audio file must be less than 300 MB in size.
Something went wrong uploading the audio file. Try reloading the page.
The maximum number of audio files you can upload is 10.
There was an error capturing an audio recording using the device's microphone. Try uploading an audio recording or video instead.
Uploaded file must be an video file.
Video file must be an audio file of type .mp4, .mov, .avi, .wmv, .avchd, .webm, or .flv.
Video file must be less than 300 MB in size.
Something went wrong uploading the video file. Try reloading the page.
The maximum number of video files you can upload is 10.
There was an error taking a video using the device's camera / microphone. Try uploading a video instead.