@fabbr You can’t nest the braces in CSS. Just take out the body {
and last }
entirely.
Read the statement by Michael Teeuw here.
Posts made by ninjabreadman
-
RE: MMM-MyCalendar
-
Trouble with Smart Quotes, etc
Someone sent you here because you were probably having trouble with smart directional (aka angled or curly) quotes. Most often this is an issue with Macs because they do “smart punctuation” replacement, including in TextEdit, the default text editor.
This is mostly a problem for quotes, where it changes quotes (
"
) to their directional alternatives (“
or”
). Here is their support document on the topic. When writing prose, this is generally a good idea. In writing code, it’s not.In Windows, such smart replacement done at a program level on certain word processors, like Microsoft Word, but not in things like Notepad, the default text editor for Windows. This is why it’s more of a problem for Mac users.
Straight double quotes (
"
) are different characters from open and close quotes (“
or”
). They look very similar to us, but the JavaScript/Node.js parser doesn’t think so. Straight quotes have the code points ofU+0022
orU+0027
, but directional quotes have completely separate code points.If you’re having trouble with smart quotes, you’ll need to start using a proper text editor that doesn’t allow the system to automatically insert directional quotes. The default editor on Mac (called TextEdit) is much more of a note taking or word processing program (much more like WordPad) than a text editor for code. It doesn’t understand code, and does things that break it. Use a true text editor like Atom, BBEdit, TextMate, etc. Or more sophisticated tools like Coda. Pick one, download it, install it, and use that to open/edit/save your config and other code files. (NB: I recommend Atom because it is supported and distributed by GitHub, is free, and is well-supported and open-source, with a good plugin architecture and community. YMMV.)
Once you’ve downloaded and installed Atom (by moving it to your
~/Applications
folder on your Mac) you can run it then open the file, or right-click a file and select “Open with…” and choose Atom. Not only will it not break your code, it will colour-code (called “syntax-highlighting”) it, show you where brackets/braces match, and can help to make your code legible (called “Beautify” in Atom).In order to edit remotely on (for example) a Raspberry Pi on your local network, you can use an SFTP client like FileZilla or CyberDuck. SFTP will need to be enabled on your RPi. You can then connect to the RPi and edit files remotely (not download, edit, upload; both programs have an “edit” option that will let you edit and save remotely in an editor … change it to Atom for js/css/html files in the preferences). This should allow you to edit files on your MM remotely.
-
RE: Modules assistance for MM newbie! Help!
@Fookes Oh, understood. You can use the little art/photo icon to upload a photo in the forum.
Are you pasting via VNC? I suggest using an SFTP client like FileZilla or CyberDuck.
You can then connect to the RPi and edit files remotely (not download, edit, upload; both programs have an “edit” option that will let you edit and save remotely in an editor … change it to Atom for js/css/html files in the preferences).
You can also use Terminal (in Applications > Utilities) to connect to your RPi via
ssh
(ex.ssh 192.168.0.100
) to run commands remotely. -
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: MMM-MyCalendar
@fabbr There is nothing (iirc) that really constrains the MM regions … they expand to fit their content. Moreover, I think some modules aren’t written with a landscape orientation in mind. I suggest you try the following in your
custom.css
:.module.MMM-MyCalendar { min-width: 200px; /* adjust number as necessary */ }
Alternatively, you can try instead using:
.region.top.left { max-width: 30%; }
-
RE: Modules assistance for MM newbie! Help!
@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. -
RE: Modules assistance for MM newbie! Help!
@Fookes No problem. You need to use a program (app) to open any file. Right now, you’re using what came with your Mac (called TextEdit). But it’s much more of a note taking or word processing program than a text editor for code. It doesn’t understand code, and does things that break it. Once you’ve downloaded and installed Atom (by moving it to your
~/Applications
folder on your Mac) you can run it then open the file, or right-click a file and select “Open with…” and choose Atom. Not only will it not break your code, it will colour-code (called “syntax-highlighting”) your code, show you where brackets/braces match, and can help to make your code legible (called “Beautify” in Atom).For adding modules, check out this walkthrough for tips: https://forum.magicmirror.builders/topic/4231/how-to-add-modules-for-absolute-beginners
-
RE: Modules assistance for MM newbie! Help!
@yawns It’s usually Macs because they do “smart quote” replacement, including in TextEdit, the default text editor. Straight double quotes (
"
) are different characters from open and close quotes (“
or”
). Such smart replacement done at a program level on certain word processors, like Microsoft Word, but not in things like Notepad, the default text editor for Windows. This is why it’s more of a problem for Mac users.@Fookes The solution is to not use TextEdit (much more like WordPad) for any code. Use a true text editor like Atom, BBEdit, TextMate, etc. Download one, install it, and use that to open/edit/save your config and other code files.
-
RE: Schedule Module with XML/Feed source
@kruemel You can make a mashup of
MMM-WeeklySchedule
for display andMMM-HTTPRequestDisplay
to fetch data which handles an XML response. -
RE: Magic mirror serving multiple clients
@zack949 Not of which I’m aware. Most dev effort is spent on the display/features end. It would also have to track the config options for dozens of regularly changing modules, which presents its own challenges.
I recommend using a syntax-highlighting code editor, like (the free) Atom. It will help with closing brackets/braces, and using the proper quotes. You can also run “Atom Beautify” in “Packages” regularly to keep formatting for legibility.