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

Fixed Overflow, Hidden Examples, and Changed HTTP Request Format #1

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

zachldl
Copy link

@zachldl zachldl commented Jun 20, 2018

Addition to lpn.js that height-constrains and scales the Swish boxes as well as a small modification to the CSS (specifically line height) in order to solve persistent overflow on the third slide of the top row due to the additional subtitle on that slide.

--

Addition to lpn.js that hides the examples visually from the code before SWISH has been activated but still includes them when the code is sent to SWISH. Functions on $(document).ready() so should be compatible with all types of code input. REQUIRES EXAMPLES TO BE THE LAST PART OF THE CODE.

--

Changed code for creating the HTTP request such that the request is now made with reference to an external file rather than containing the entire code itself, which caused some problems. A new button and element-swapping system had to be implemented, but the visual change is minimal. The preview (before Swish is loaded) still relies on the local copy of prolog_scripts, so this must not be removed.

--

New method of displaying button no longer requires modification to swish_box.html and looks nicer.

zachldl added 5 commits June 20, 2018 13:03
Swish text is now height-constrained, scrollable, and height scales to window size.
Added a three-step scaling gradient based on vertical resolution to fix the overflow coming back on extremely high- or low-resolution displays, and narrowed the line spacing very slightly to fix the overflow on the third slide on the top row which previously happened due to the added subtitle.
Added a three-step scaling gradient based on vertical resolution to fix the overflow coming back on extremely high- or low-resolution displays, and narrowed the line spacing very slightly to fix the overflow on the third slide on the top row which previously happened due to the added subtitle.

Edited - accidentally left some visual changes I was meaning to undo in the last commit.
Hides the examples visually from the code before SWISH has been activated but still inclues them when the code is sent to SWISH. Functions on $(document).ready() so should be compatible with all types of code input. REQUIRES EXAMPLES TO BE THE LAST PART OF THE CODE.
@zachldl zachldl changed the title Fixed Overflow Fixed Overflow and Hidden Examples Jun 21, 2018
Code is now preloaded into Swish by inputting the address of the external file hosted on GitHub in the COMS30106/prolog_scripts repository. No changes need to be made to the existing examples present or to the method in which new examples are added, as the address is created from the ID of the <pre> tag, which is already present for all of the Swish boxes. A new button and element-swapping system had to be implemented to facilitate this, but the visual change is minimal. Currently, the contents of the box before Swish is activated are still pulled from the 'local' set of prolog scripts, however, so these should not be removed.
@zachldl zachldl changed the title Fixed Overflow and Hidden Examples Fixed Overflow, Hidden Examples, and Changed HTTP Request Format Jun 21, 2018
zachldl added 4 commits June 22, 2018 11:35
Changed the button to display in a better location which will also work for the vertical-scrolling book format. Reverted potentially problematic changes to line-height. Changed the way the button is inserted into the document such that modifications to the swish_box.html file are no longer necessary and have been undone.
Cleaned up the code, consolidated all of the $(document).ready(function(){}) statements into one, removed extraneous code, and added comments.
Folder to be removed later. Only being used temporarily to troubleshoot irregular SWISH behaviour.
In lpn_overflowfix_examplesfix_iframefix_previewfix.js the previews are now also loaded from an external file, as well as the iframes. This uses asynchronous AJAX requests so loading times should not be severely impacted.

All of the major changes to lpn.js are now staggered. The first four all use the original index.html but the one with the most changes uses index_overflowfix_examplesfix_iframefix_previewfix.html as it also uses new_swish_box.html from _includes.
web/js/lpn.js Outdated
@@ -23,7 +23,7 @@
return this.each(function() {
var elem = $(this);
var data = {}; /* private data */

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix the tab sign

zachldl and others added 2 commits June 25, 2018 15:36
Removed a line in lpn.js which interfered with the CSS and created incorrect scrollbars.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants