@Fookes Yes, but how are you opening your config.js
to paste in your options/configuration? There is an app/program that opens and interprets the file, then saves it again. Whatever you’re using, it is permitting MacOS to change your quotes, thereby breaking the file.
Read the statement by Michael Teeuw here.
Best posts made by ninjabreadman
-
RE: Modules assistance for MM newbie! Help!
-
RE: fs.stat SyntaxError: Unexpected token
@pepebc It may depend on what precedes that snippet (if anything). Try copy/pasting the whole file into JSHint, it may give you a better idea. Also, doesn’t
fs.stat()
take apath
as the first argument? -
RE: Improve updatenotification module (to be module selective)
@E3V3A But also means you lose the metadata stored in
.git
to manage (incl. update later) via.git
without renaming the folder.Why not have
updatenotification
iterate over/skip modules on the blacklist? Something like changing this line innode_helper.js
:if (defaultModules.indexOf(moduleName) < 0) {
To the following?
if (defaultModules.indexOf(moduleName) < 0 && this.config.ignoreModules.indexOf(moduleName) < 0){
This means if the module is either (1) in
defaultModules
or (2) in the (new)ignoreModules
it gets skipped.Remember to also add
ignoreModules: []
todefaults
inupdatenotification
. You can then avoid altering the filesystem whatsoever. -
RE: Modules assistance for MM newbie! Help!
Sorry @Fookes, when @yawns mentioned MacOS and you didn’t say you weren’t using a Mac, I assumed that to be the case (given the quotes problem). Did you install Atom on your own computer or the RPi? Are you editing your files on the RPi itself (via a keyboard, in Terminal) or are you connecting remotely from other computer (typically
ssh
)?As a command-line text editor,
nano
respects quotes and should not cause a problem, although I typically avoid pasting code blocks – I find overssh
that the paste buffers and encodings can get weird. -
RE: Input field forces restart instead of update
@joncedimov If it’s the [enter] causing problems, you may need to override/disable the
onsubmit
event listener for the form. It may be that you’re submitting the form, MM has no idea what to do with that data, and so simply displays (reloads) the same page. -
RE: Get JSON data stuck behind CAPTCHA click???? i.e. US Gas Prices
@hsukup1 It’s not an easy problem. The crowdsourced solutions are not good, and the private solutions are not cheap. There’s MyGasFeed, but like GasBuddy it relies on crowdsourced data. Do you need station-specific data? AAA has state and municipal data available on their website.
It looks like Geico also offers prices via the mobile app. You could install it, perform the search, and inspect the traffic and query. It could very well be making unobfuscated calls to the API. Just keep in mind that relying on that method, it may eventually break (especially if you attract attention with abuse of the API).
-
RE: MMM-cryptocurrency side by side top bar
Hi @StacheEnthusiast, in
getDom()
atMMM-cryptocurrency.js:164
it creates the layout for the module in atable
. It loops through, and for each currency creates atr
(table row) andtd
(table cell).It looks a bit like this:
So I think if you take the
tr
creation outside of the loop, it should work:getDom: function() { if (this.config.displayType == 'logo' || this.config.displayType == 'logoWithChanges') { this.folder = (this.config.coloredLogos ? 'colored/' : 'black-white/') return this.buildIconView(this.result, this.config.displayType) } var data = this.result var wrapper = document.createElement('table') wrapper.className = 'small mmm-cryptocurrency' var tableHeader = document.createElement('tr') tableHeader.className = 'header-row' var tableHeaderValues = [ this.translate('CURRENCY'), this.translate('PRICE') ] if (this.config.headers.indexOf('change1h') > -1) { tableHeaderValues.push(this.translate('CHANGE') + ' (1h)') } if (this.config.headers.indexOf('change24h') > -1) { tableHeaderValues.push(this.translate('CHANGE') + ' (24h)') } if (this.config.headers.indexOf('change7d') > -1) { tableHeaderValues.push(this.translate('CHANGE') + ' (7d)') } for (var i = 0; i < tableHeaderValues.length; i++) { var tableHeadSetup = document.createElement('th') tableHeadSetup.innerHTML = tableHeaderValues[i] tableHeader.appendChild(tableHeadSetup) } wrapper.appendChild(tableHeader) var trWrapper = document.createElement('tr') // moved from below trWrapper.className = 'currency' // moved from below for (i = 0; i < data.length; i++) { var currentCurrency = data[i] // var trWrapper = document.createElement('tr') // trWrapper.className = 'currency' var name if (this.config.displayLongNames) { name = currentCurrency.name } else { name = currentCurrency.symbol } var tdValues = [ name, currentCurrency.price, ] if (this.config.headers.indexOf('change1h') > -1) { tdValues.push(currentCurrency.percent_change_1h + '%') } if (this.config.headers.indexOf('change24h') > -1) { tdValues.push(currentCurrency.percent_change_24h + '%') } if (this.config.headers.indexOf('change7d') > -1) { tdValues.push(currentCurrency.percent_change_7d + '%') } for (var j = 0; j < tdValues.length; j++) { var tdWrapper = document.createElement('td') var currValue = tdValues[j] // If I am showing value then set color if (currValue.includes('%')) { tdWrapper.style.color = this.colorizeChange(currValue.slice(0,-1)) } tdWrapper.innerHTML = currValue trWrapper.appendChild(tdWrapper) } // wrapper.appendChild(trWrapper) } wrapper.appendChild(trWrapper) // moved from above return wrapper },
I’ve not run this code, as I don’t use
MMM-cryptocurrency
, but I think it should work. Just be careful when modifying yourMMM-cryptocurrency.js
to only replace thegetDom()
function. I also don’t think this should break any of the module’s functionality or styling.Worst case, you can always use
git checkout MMM-cryptocurrency.js
to revert to the original version. -
RE: Messed up CSS between Portrait and Landscape monitors
Hi @Damian,
I’m on my phone atm, so will try to look in more detail later. It depends on the screen resolution, but also (as I’m sure you realize) you can fit less vertically with a landscape display.
You’re is a complicated question. I recommend a combination of repositioning and resizing.
First, you may want to see what (else) you can move to
top_center
andbottom_center
to make more room. Alternatively, if you don’t want to use those, you could make.region.left
and.region.right
wider (say, 50%). But you don’t have any text “wrapping” to new lines in your module, so in your case won’t help much.Second, you can resize by changing the
font-size
for the entire page (in yourcustom.css
) like this:body { font-size: 73%; }
This value will then be inherited by (or “cascade to”, hence CSS) by all other elements in the DOM (i.e. on the page). You can also change the
font-size
of a specific module; your “family home” calendar seems like a great contender.Finally, you may also want to limit the width of your newsfeed.
I think this should put you on the right course. Post any questions, let us know how you fare. I’ll check in later to help if I can.
-
RE: Changing the length of the line under the header
@MadScientist I’ve always liked W3Schools. It’s very concise, but introduces each concept and lets you play with it.
There are also learning/coursework sites like CodeAcademy, Code School, udemy, etc.
Groups like Ladies Learning Code also have slides and sample code available to walk you through.
There is CSS, but there are also media queries, CSS animations, layout frameworks, CSS extensions/preprocessors like Sass & LESS, among other things. Let alone different limitations, workarounds, and other peculiarities for different desktop and mobile browsers.
Finally, the best way to learn and retain is often to apply it. Building things will often reinforce whatever you learn through the sites and materials above.
-
RE: MMM-cryptocurrency side by side top bar
@StacheEnthusiast You’re right. Tables don’t take styling very well; table rows (
tr
) insist on taking their own line, so there’s no easy way to move them beside each other. The proposed solution above should circumvent this, putting all the cells (td
) into a single row.