chris--a / moduino Goto Github PK
View Code? Open in Web Editor NEWA JavaScript modification system for the Arduino forum.
Home Page: http://arduino.land/Moduino/
A JavaScript modification system for the Arduino forum.
Home Page: http://arduino.land/Moduino/
After a forum update, the code boxes CSS has changed how its sized. Once highlighting has been applied the horizontal scroll bar is hidden.
The inner code container needs to be set to the same height has the outer wrapper. Previously the inner container sized automatically to its parent.
This may still apply to IE, however it needs an additional fix before the problem becomes evident (#10).
Currently the forum uses the PHP built in highlighter for PHP code. It effectively wraps the source in <span>
tags which are rendered as plain text once highlighted using JavaScript.
By removing the tags before highlighting and setting the highlighter brush to PHP, it can be handled effectively.
Many features are provided via JavaScript CDN repositories to alleviate some of the load off the Moduino server. Occasionally these servers can become inaccessible due to unforeseen load or malicious attack.
To prevent the remote likelihood of a missing script from rendering the forum unusable, the system should be able to fall back to a locally served copy (Moduino server).
This should not happen as checks are made to validate the existence of particular features. However a backup would be nice to prevent missing features.
Arduino keywords should be included into the JavaScript theme for the syntax highlighter system.
Default highlighting or even specific colours and other text styling could be used.
When themes have been implemented, Arduino code elements could even be hyper-linked to the actual reference material, like analogRead()
, or #include<Spi.h>
. This feature would be in the proposals for the forum section which could be an actual beginner/newbie theme encapsulating the proposals.
The multi browser fix for the code boxes now has a bug.
The RegEx replace group strips <
& >
now leaving includes like #include xx.h
.
e.innerHTML = e.innerHTML.replace(/\<br\>/gi,"\n").replace(/(<([^>]+)>)/gi, "").replace( /<br>/g,'\n' );
The line should simply omit the second replace call.
e.innerHTML = e.innerHTML.replace(/\<br\>/gi,"\n").replace( /<br>/g,'\n' );
When testing the system (not installed, just through console) the window.onload
event does not fire for new code, only on the initial load. This seems to only affect IE.
It appears that this may be unavailable for some time.
arduino/forum-assets#100 (comment)
Some people may be interested in this. It can be embedded inline or in a dialog. An option for auto application or on click of a screen element would be good.
Things like 'Recent Posts' and 'Unread topics' can be filtered by a selection of preferred boards (or at least to omit the ones in different language). If wanted a user should be able to set a filter as a default action for these kind of pages.
While viewing a thread...
Rather than forcing a download, images should be inserted into the thread or loaded into a popup/new tab removing the automatic download of the file for local viewing.
Members who do not have an avatar specified should have an avatar provided by gravatar.com. By using the use name/ID each person will keep their own unique picture.
When viewing a thread, each post has a tool bar underneath the content with a report link, and a quote link. Moderators would have more buttons.
Hide the bar and move the links into a hover over menu that appears when hovering a post.
Rather than showing a date and time as currently displayed:
Today at 23:33:11
by SomePoster
or
11-12-2014, 23:42:01
by SomeOtherPoster
Times could be displayed relative to the users time. This would depend on the user setting the timezone in their forum preferences. The posters name could replace the time on hover-over resulting in a shot time like:
30 seconds ago
10 minutes ago
yesterday
or yesterday 13:50
2 months ago
last year
2 years ago
Should fix issues found here: arduino/forum-assets#156
Depending on the direction of the page flow, show the signature closest to the latest post. All duplicates are hidden.
At the bottom of each page is a combo box containing a list of the forums. Selecting one from the list causes the browser to redirect to that forum.
This list has a delay as the contents is fetched using AJAX when the item comes into focus. Moduino could activate the AJAX after page load allowing the contents to be usable as soon as possible.
Or Moduino could store the contents in a cookie and disable the AJAX feature, allowing instant access.
Noticed today that Moduino stopped working in the forum. Maybe due to Firefox updates.
Each forum listing shows the last post title and time.
The titles are truncated to a short length and the tool tip hover-over contains the full text.
If the width of the page permits it, the truncated text should be replaced with the tool tip text.
Currently the end of quotes are fixed with a mod. However there are multiple line breaks encountered everywhere.
These include the break between a [code]
/[quote]
box and the next line, which removing these will get rid of the initial empty line in almost every quote.
Rather than having the browser load each page when a link is clicked ( what normally happens ), use ajax to load the html then reload the document with the content.
This will allow vast speed improvements.
JavaScript and CSS files can be replaced with the inline code already downloaded on the current page. Instead of sending many requests which will either download un-cached content or return 304 not modified
we can prevent all requests by injecting the code inline before loading the document. This would fix the problem highlighted by Google Page speed insights where it mentions content blocking JavaScript's/resources.
Things like smilies can be removed and either loaded on click, or at a more appropriate time ( after everything else ).
Mods will have the ability to run instantly, rather then on jQuery.ready
(css and js for things like syntax highlighting), many mods using the later event window.onLoad
can be moved to an earlier event.
Things like the 404
cron ajax can be prevented from wasting resources.
This would speed up the client side, and the server has less requests from you so a performance boost is expected.
When a user is not logged in, a PHPSESSION
variable, and possibly others, are passed with the URL. Regular expressions need fixing to allow for this.
This isn't a problem of the syntax highlighter system, but the code used to get the text ready. Line breaks <br>
are not getting converted to \r\n
equivalents in IE.
Karma counts are now visible once again.
The mod: combining the add karma link with the Karma count no longer works.
There are two discussion thread links on http://arduino.land/Moduino/ but they just point back to http://arduino.land/Moduino/. I did a search for the forum thread and couldn't find it.
When a user copies code which contains tab characters, the forum software encodes these as a span of four characters. The syntax highlighting pre-processor wraps the text in <pre>
tags which make the spans render as plain text.
E.g: <span style="white-space: pre;"> </span>
This only became apparent when #17 was fixed, before then the spans were removed resulting in bad formatting of text.
The last post link now has a preset width of 8%, which causes the date, time, and user name to each be on a single line.
This should be fixed to allow a single line containing all elements on large screens.
Relevant to issue #9.
In the banner is a profile picture which goes to the site SSO profile. It should be redirected to the forum profile instead.
A bug appears when using the forum while not logged in.
The signup/login buttons are hidden when the banner shrinks. These need to be visible.
After applying the theme an image may finish loading. When it displays the post box does not resize to accommodate it, therefore it overlaps the next post(s).
Css should be responsive, or a JS event should fix the sizing.
Some JavaScript files are loaded using AJAX and some are loaded by adding a script tag into the HTML. There is no problem with either of these, except the fact the forums existing code will cause a delay in loading when using the HTML tag version.
An unknown script will modify the src
attribute adding an extra parameter which changes with each page load. This causes the browser to download a fresh copy every time. Whereas the unaffected AJAX method will use a cached copy if already downloaded.
Sometimes people post images with a huge resolution. A mod should be added to auto shrink images to a reasonable size.
The option to enlarge can be added also. For super large images the increase can be in steps.
Show text or icon next to the blacklisted user names to indicate that they are on the list.
The reason for this request is that there are always a few forum users who are disrespectful, consistently don't follow the rules, trolls, etc. Once I have identified them as such, I'd rather put my time on the forum to helping others but it's hard to remember who's who.
An enhancement would be to allow multiple lists with different indicators, something like blacklist, warned, friend. The "friends" list(not the best name for it but you get the idea) would work in the opposite manner from the other lists: I would like to put more time towards helping users who have previously demonstrated they are willing to make an effort to learn or have made contributions to the community.
When visiting a multiple page topic , or thread index Ajax should be utilized to retrieve the next pages content.
This could be done automatically when the scroll position reaches the bottom of the page, or on the click event of a button placed under the current content.
This will save on requests ( 1 ) and can be done using the RSS feed which is far smaller in size. The template for a post or topic can be copied from the current page.
Could be combined with feature #4.
When a quote has a nested code box, which has had the SyntaxHighlighter mod applied there can be an issue. If line numbers are turned on, these are also selected with the code.
The select all button should destructively remove the line numbers, or hide them until the selection is cleared or outside of the quote.
This does not affect the select all feature for the actual code box (nested or not).
When moving to a page where the focus isn't the top of the page, the nav bar fails to hide with the mod active. This seems to be a result of a recent forum upgrade.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.