Read the statement by Michael Teeuw here.
remotecompliments disappeared - please help
-
@forjer modifying?
no need to modify ( never modify module source code)
code two modules wherever u want.
put the compliments text in the config block in config.jsI am on my phone so everything but the actual compliments
{ module:"compliments", position:"lower_third", config:{ compliments:{ same as in defaults section of code whatever compliments for module 1 } OR remotefile:"http://....... somefile on some server" } }, { module:"compliments", position:"upper_third", config:{ compliments:{ same as in defaults section of code whatever compliments for module 2 } } } -
@sdetweil Progress. So I saved a copy of my modified compliments.js into a compliments2 folder as compliments2.js and renamed module.register to compliments2. I then reverted my compliments.js back to original. I then added a compliments2 section into my config.js. And now I have two separate compliments running! I tried that a few hours ago but I must have done something wrong so it didn’t work.
In the way you coded it, would I be able to have the ability to run Module 1 with the default time slots (complimentArray) while Module 2 runs a different time slot schedule?
Now I think I’d like to get a remotefile set up but I’m guessing I’ll run into some issue with remotefile for my compliments2.
-
@sdetweil Also, is there a way to get my compliments2 to allow time splits at say 11:30 instead of just integer hours? Something like the following?
afternoonStartTime: 11:30, afternoonEndTime: 13,It would appear the complimentArray would need to be adjusted by changing “hour” to something else?
} else if (hour >= this.config.afternoonStartTime && hour < this.config.afternoonEndTime && this.config.compliments.hasOwnProperty("afternoon")) { compliments = this.config.compliments.afternoon.slice(0); -
@forjer read the doc
u can have different remotefiles too
-
@forjer if u need 10 time slots, then the compliments module would need changing as u might already have done. u should change your own copy, and then use that
from the modules folder
cp defaults/compliments mycompliments
have to change the module register at the top to be the same as the folder name u create on the copy -
@forjer looks like the default time slots are hour based. so another reason to make your own
-
@sdetweil Thanks for all of you time and help. You are a wealth of knowledge.
I’ve only been digging into this thing for a few weeks and I’ve seen so many of your posts helping others. Kudos!I like this kind of stuff, I just wish I had better core knowledge so I didn’t spend so much time looking stuff up and tinkering, but I guess that’s one way to learn.
I have gotten my custom “compliments2” module to work, but still only with integers for time. There’s got to be a simple way to change that. I’ll keep looking.
-
@forjer said in remotecompliments disappeared - please help:
but still only with integers for time.
what do u mean?
-
@forjer my son calls me all the time w questions. I don’t know much, but I know how to search, and can usually find an answer pretty quick.
I do it here too, all the time, writing code, working on install issues. trying to help w modules I don’t know.
I didn’t know we could run multiple compliments modules concurrently, but I figured it out looking at the code.
-
@sdetweil said in remotecompliments disappeared - please help:
@forjer said in remotecompliments disappeared - please help:
but still only with integers for time.
what do u mean?
I mean that by default, compliments only allows defining “morningStartTime” as 5, but I would like to be able to do is define it as 5:35.
-
@forjer so, allow the start/end time to be hh:mm
then check and split if contains ‘:’
make mins default to 00 if not// make starttime always have minutes if specified use them, if not use 00 config.startTime=config.startTime.inclides(':')? config.startTime, config.startTime+':00' and then split (split(':') and convert parts to numbers (parseInt()) var temp = config.startTime.split(':') temp[0] = hours temp[1] = minutes this.afternoonStartHour = parseInt(temp[0]) this.afternoonStartMinute = parseInt(temp[1])repeat for all your time windows
then change the code to compare
might be able to use moment() before()/after() if u build a moment() value from the time slots.
I think moment has an isBetween()
https://momentjscom.readthedocs.io/en/latest/moment/05-query/06-is-between/google is your friend
-
@sdetweil I will have to mess with that when I have more time.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login