audreyt / ethercalc

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

ONEDITDO() #572

Open agaliga opened 6 years ago

agaliga commented 6 years ago

This ONEDITDO () function ( on edit do ) will work like the EMAILONEDIT() it was discussed here #389 and implimented here chrismarkcellmaster which was forked from cellmaster. I tried to impliment this in ethercalc with no success.

bear with me if my questions sounds stupid

eddyparkinson commented 6 years ago

what is the difference between ethercalc and cellmaster designed by @eddyparkinson

ethercalc = cellmaster

Suggest you use ethercalc, rather than cellmaster. All the main features are the same.

They are 95% the same. Some cosmetic differences. Also some features require cron and gmail oauth2 setting up to work. Cellmaster was designed to on openshift, but the old outdated version. There are some differences because of small changes made to openshift.

Which code or file exactly do i need to copy from chrismarkcellmaster and where exactly do i need to impliment it in ethercalc

Most changes are in this file: https://github.com/chrismark/socialcalc/blob/master/formula1.js

but also see: https://github.com/chrismark/cellmaster/commit/0c19166ea4107f04607b04dee31a0d7d14bce7a7

is there a way i can locally run cellmaster?

Yes. Follow the ethercalc instructions and it should run locally. But it changes the dump.json file location.

if i have my custom css and javascript , how do i link to the spreadsheet page because making changes to index.html doesn't seem to affect anything

CSS: You can put css in a cell. Change the cell type to html and add the html with style="..."

Javascript: when do you want it to trigger? adding a new formula to formula1.js is maybe the simplest way. There are action formulas that only run when a trigger happens, such as a button press.

inspecting the element on the spreadsheet editor , you will see some html markup ( ) which file actually generate the tables on the editor?

SocialCalc.InitializeSpreadsheetControl and InitializeSpreadsheetViewer https://github.com/chrismark/socialcalc/blob/master/socialcalcspreadsheetcontrol.js#L952 https://github.com/chrismark/socialcalc/blob/master/socialcalcviewer.js#L217

is it possible to play audio file in ethercalc? maybe a function like PlayAudio(audio url )

yes, via javascript - see above.

agaliga commented 6 years ago

Thanks @eddyparkinson ,

Most changes are in this file: https://github.com/chrismark/socialcalc/blob/master/formula1.js

on my local installation of ethercalc i replaced node_modules\ethercalc\node_modules\socialcalc\formula1.js with https://github.com/chrismark/socialcalc/blob/master/formula1.js

then open an empty calc and typed =ONEDITDO () but it show this error unknown function ONEDITDO

is there anything i did wrong ? any idea on the function ONEDITDO ( i don't mind if i'm spoon fed ) :blush:

eddyparkinson commented 6 years ago

Can you find the ONEDITDO - like this: https://i.imgur.com/D2BW0KO.png

It should have been compiled to the ethercalc.js file, see image.

agaliga commented 6 years ago

Thanks @eddyparkinson , i have looked at the image but could not see any ONEDITDO function there , but i saw EMAILONEDIT. i just want a function that will trigger some sheet commands if a user edit a range . The trigger should get fired as soon as the user exit a cell without the need to use the Button() function. I'm beginning to give-up on this :blush: maybe an example calc might solve my nightmare

eddyparkinson commented 6 years ago

You have ONEDITDO in formula1.js, but it needs to be in ethercalc.js - to do this you use make (run the makefile). This will put ONEDITDO into ethercalc.js

agaliga commented 6 years ago

thanks @eddyparkinson for answer/patience note i'm a newbie to both nodejs commands and ethercalc

You have ONEDITDO in formula1.js, but it needs to be in ethercalc.js - to do this you use make (run the makefile). This will put ONEDITDO into ethercalc.j

first i did npm install -g node-make

then in the ....node_modules\ethercalc\node_modules\socialcalc run the following in command window mk restarted ethercalc ( ONEDITDO function didn't work ) make restarted ethercalc ( ONEDITDO function didn't work ) finally :blush: :blush: i gave up :blush: @eddyparkinson you did your best to explain it to me but my node skills is too elementary grasp your explanation . i gave up ONEDITDO function Thanks

eddyparkinson commented 6 years ago

You could copy https://github.com/chrismark/cellmaster/blob/oneditdo/static/ethercalc.js and https://github.com/chrismark/cellmaster/blob/oneditdo/SocialCalcModule.js into your copy of ethercalc

that should be enough to make ONEDITDO work.