I have files such as this that have translation keys and values: When I add a new translation key to the JSON file containing the English translations for example, I must remember to add that key and the associated translation to all the other JSON files. All the JSON files are also edited separately. The pro…
Author: admin@master
Communicate with the serial port from client web browser.
In my web application(sencha extjs 5) I have a user requirement to read/write data to the client PC serial port. I am aware of the client browser can not access local machine hardware without installing some binaries on the local machine(Native app, Windows Service, etc..). I have seen the same question is di…
Which is the prefered way to add function to sockets in socket.io?
Is there a “prototype” of all sockets connected to socket.io? I want to define some functions that will be available for each connected socket. Currently i have: But i’m defining a ‘new’ hello function for each socket. Is there a socket prototype? so i can have something like: An…
Using Javascript’s atob to decode base64 doesn’t properly decode utf-8 strings
I’m using the Javascript window.atob() function to decode a base64-encoded string (specifically the base64-encoded content from the GitHub API). Problem is I’m getting ASCII-encoded characters back (like ⢠instead of ™). How can I properly handle the incoming base64-encoded stream so that it̵…
Protractor, with isDisplayed() I get NoSuchElementError: No element found using locator
In protractor 2.0, I am checking in a expect() if one element is displayed. I expect a false, but the weird thing is that I get following error: NoSuchElementError: No element found using locator: By.id(“userForm”) My code is: I understand that I get that error because element is not longer on the…
JS (No Jquery) – Change CSS when scrolled to a set point
Sorry, but I am a complete noob with JS. I am using Bootstrap to try build my first website. The website has a fixed top navbar. I want to change the navbar’s border-bottom properties when it reaches the bottom of the header div (about 480/500px down the page). Currently the border-bottom is white, but …
How to (sort of) add code to fullcalendar’s renderEvents handler?
I’m using fullcalendar 1.6.3 along with Drupal 7 (thus the need, for now, to be back on 1.6.3). I have some code that I’d like to run every time the view of my calendar changes (via ajax requests) — forward or backward in time, or between month/week/day view. Based on some tests, I could do …
How to show div with date at the beginning of a conversation and every time the conversation is active again on another date
I am making a chat application with AngularJS and JavaScript and when you begin a conversation with someone I want to show a div (blue date in the picture) to show indicating at what date the conversation has begon. And when the conversation is over and started again on another date I want to show the date di…
Does ES6 introduce a well-defined order of enumeration for object properties?
Does ES6 introduce a well-defined order of enumeration for object properties? Answer Note: As of ES2020, even older operations like for-in and Object.keys are required to follow property order. That doesn’t change the fact that using property order for fundamental program logic probably isn’t a go…
How to collapse/expand accordion in a Q&A form after input selection
Not sure if that’s the correct vocabulary, but here’s what I’m trying accomplish. I’m working with a team on this big multi-page Q&A application, my task is make one particular page use the least amount of screen real estate as possible. I’m using an accordion, each one has a…