audreyt / ethercalc

Node.js port of Multi-user SocialCalc
https://ethercalc.net
Other
2.97k stars 537 forks source link

My Wish for Ethercalc #571

Open enemali opened 6 years ago

enemali commented 6 years ago

If only I understood ethercalc source code and know how to code in livescript , here are some features I would love to see / implemented

  1. Those lock/unlock cell button , when a user clicks the lock cell , a javascript input box will pop up asking “enter the lock password” and another input box below it will read “enter the cell to save the password to “ . Then an OK button takes the user input and saved it in the specified cell. When the unlock button is clicked an input box pops up “ enter the unlock password” . After OK is clicked it compares the input with the content in that cell, it then unlock the ranges or cell. Though this is not a foolproof security but can be useful
  2. Implement some Get() Functions i. Get current/active cell content ii. Get active row/column number/name
  3. Hyperlink to another cell within the same sheet / workbook
  4. Function that will be triggered at certain time interval
  5. RunJavascript() function This will enable writing of custom javascript within a sheet
  6. Filter and search button/trigger on forms
  7. Export certain range as PDF
  8. And many more I’m just an ordinary spreadsheet user but maybe pointing me to the code# where any of these can be implemented will also be helpful Thanks to @eddyparkinson , @audreyt and others for this wonderful software
eddyparkinson commented 6 years ago

Have you got one you want to start with. I will tell you which parts of the code to look at.

Javascript vs Livescript - I think you only need Javascript - the live script is for server side code, so apart from the PDF all the above are Javascript. .. Note the livescript gets converted to javascript, maybe you know.

Function that will be triggered at certain time interval

This works, but requires cron on the server, so can be hard to setup, but all the code is there for this.

Which first, where would you like to start?

enemali commented 6 years ago

Thanks @eddyparkinson for your interest in my queries

The one i want to actually start with is

Function that will be triggered at certain time interval the idea is simply to change the colour background colour of certain cell every five or ten seconds , i want to constantly catch my users attention with certain message which serves as a reminder to them . so the time interval function can trigger the different style() function or other function. ( i guess i want to add little animation to my sheet even though that's not what spreadsheet are meant for or the time interval function can trigger JavaScript alert("reminder notice") though this can annoy some users but its possible i will a direction

if its possible , my second priority is

Those lock/unlock cell button , when a user clicks the lock cell , a javascript input box will pop up asking “enter the lock password” and another input box below it will read “enter the cell to save the password to “ . Then an OK button takes the user input and saved it in the specified cell. When the unlock button is clicked an input box pops up “ enter the unlock password” . After OK is clicked it compares the input with the content in that cell, it then unlock the ranges or cell. Though this is not a foolproof security but can be useful

Another one if functions like the following exist

EMAILONEDIT() and EMAILONEDITIF()

then i will like to implement some function like COMMANDONEDIT() COMMANONEDITIF()

i want to trigger the command() and commandif() functions on edit of some certain ranges without manually clicking a button or can buttonClick be triggered via function?

i will appreciate directions on these above and any achievable one from the first post. thanks

eddyparkinson commented 6 years ago

Adding an animation Lots of options, too many...

You could add an animated gif. ="{image: http://www.barcodes4.me/barcode/"&B2&"/AnyValueYouWish.png }"

Or css - as searching for "css animation examples" gives lots of css options. You can add raw HTML into a cell with style tags etc.

The issue is more when it should run/change/stop. For this:

browser based time trigger

Maybe add a browser based time trigger (rather than server based) - you could add new trigger formulas such as "setTimeout()" and "setInterval()" based on https://www.w3schools.com/jsref/met_win_settimeout.asp

These would work very much like a button. And cause action formulas to execute.

Action formula could then replace a gif or css in a cell to change the message/image.

Look at the BUTTON formula here: https://github.com/marcelklehr/socialcalc/blob/master/formula1.js for a starting point.

Adding - COMMANDONEDIT() COMMANONEDITIF()

COMMANDONEDIT etc is maybe the simplest. See: https://github.com/marcelklehr/socialcalc/blob/master/formula1.js#L5003 https://github.com/marcelklehr/socialcalc/blob/master/formula1.js#L5042

To make this work - addin the new formulas to formula1.js should be enough.

lock/unlock cell suspect the hard bit of this is to store/update the password - the rest would be a small change to the lock button code.

enemali commented 6 years ago

Thank you so much @eddyparkinson for the guidance , i will take my time to implement them even though for now its not really easy to me as you described here

COMMANDONEDIT etc is maybe the simplest. See: https://github.com/marcelklehr/socialcalc/blob/master/formula1.js#L5003 https://github.com/marcelklehr/socialcalc/blob/master/formula1.js#L5042

i guess its due to my weak knowledge in coding . i also guess my starting point is to add

, COMMANDONEDIT: [14, 14, 14, 14, 14]
, COMMANONEDITIF: [14, 13, 14, 14, 14, 14]

to the list around https://github.com/marcelklehr/socialcalc/blob/master/formula1.js#L5042 then the next step is something i will need to figure out ( don't want to bother you with dumb questions)

what i want to achieve with the COMMANDONEDIT() COMMANONEDITIF() function is to act as a data validation on cell edit within some specified range , so that if a user enters a value above the required value an alert message pops up notifying the user of the entry.

Thanks again.

eddyparkinson commented 6 years ago

if a user enters a value above the required value an alert message pops up notifying the user of the entry.

try entering 2 into this: https://ethercalc.org/example_validation/app https://ethercalc.org/example_validation

Then a submit button can be made grey with css, css that changes based on the validation. The style() formula can add css to a button (or any gui widget)

enemali commented 6 years ago

that was a brilliant alternative to my validation message alert. It's useful where data are entered via form and a finally a submit button sends the data but if multi-cell data entry ( B1:B100) is entered via the spreadsheet interface , it might not force the user to enter a valid data. Thanks for the example, i will surely use it