www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - dpaste and warning upon leaving page

reply Anonymouse <asdf asdf.net> writes:
I just had a PEBCAK moment where I was composing a large-ish 
snippet on dpaste, then accidentally left the page by clicking 
the back button on my mouse. Going back to the page I see my 
changes were lost.

Could we maybe add a warning when leaving the page if the content 
has been changed? I think it's the onbeforeunload event, but I 
don't know javascript well.

http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onbeforeunload_dom
May 10 2016
next sibling parent reply nazriel <spam dzfl.pl> writes:
On Tuesday, 10 May 2016 at 16:39:05 UTC, Anonymouse wrote:
 I just had a PEBCAK moment where I was composing a large-ish 
 snippet on dpaste, then accidentally left the page by clicking 
 the back button on my mouse. Going back to the page I see my 
 changes were lost.

 Could we maybe add a warning when leaving the page if the 
 content has been changed? I think it's the onbeforeunload 
 event, but I don't know javascript well.

 http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onbeforeunload_dom
Good idea. I've added it to TODO list here https://github.com/nazriel/dpaste-frontend/issues/3
May 11 2016
next sibling parent reply ZombineDev <petar.p.kirov gmail.com> writes:
On Wednesday, 11 May 2016 at 11:27:44 UTC, nazriel wrote:
 On Tuesday, 10 May 2016 at 16:39:05 UTC, Anonymouse wrote:
 I just had a PEBCAK moment where I was composing a large-ish 
 snippet on dpaste, then accidentally left the page by clicking 
 the back button on my mouse. Going back to the page I see my 
 changes were lost.

 Could we maybe add a warning when leaving the page if the 
 content has been changed? I think it's the onbeforeunload 
 event, but I don't know javascript well.

 http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onbeforeunload_dom
Good idea. I've added it to TODO list here https://github.com/nazriel/dpaste-frontend/issues/3
nazriel, a bit off topic, do you have any plans to open-source the code? I'm using dpaste quite often and it would be really nice if I could contribute. Also can you provide an option for the nightly dmd builds? There's a nice script, which you can use to manage them (http://dlang.org/download - look for install.sh; https://github.com/dlang/installer/blob/master/script/install.sh).
May 11 2016
parent reply nazriel <spam dzfl.pl> writes:
On Wednesday, 11 May 2016 at 18:41:12 UTC, ZombineDev wrote:
 On Wednesday, 11 May 2016 at 11:27:44 UTC, nazriel wrote:
 On Tuesday, 10 May 2016 at 16:39:05 UTC, Anonymouse wrote:
 I just had a PEBCAK moment where I was composing a large-ish 
 snippet on dpaste, then accidentally left the page by 
 clicking the back button on my mouse. Going back to the page 
 I see my changes were lost.

 Could we maybe add a warning when leaving the page if the 
 content has been changed? I think it's the onbeforeunload 
 event, but I don't know javascript well.

 http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onbeforeunload_dom
Good idea. I've added it to TODO list here https://github.com/nazriel/dpaste-frontend/issues/3
nazriel, a bit off topic, do you have any plans to open-source the code? I'm using dpaste quite often and it would be really nice if I could contribute. Also can you provide an option for the nightly dmd builds? There's a nice script, which you can use to manage them (http://dlang.org/download - look for install.sh; https://github.com/dlang/installer/blob/master/script/install.sh).
Yeah, I am 100% for open sourcing everything and making it fully non-dependant on me. New version of the backend is already on GH and in the near future (matter of days) it will go live! :) Regarding frontend - I am not sure if I want to release the php version. It is total mess... Small spoiler alert but D+vibed version of fronend is coming very soon and that will be on gh and deployed. stay tuned. Nightly builds... At the moment we have got independant builds of master going on daily basics but I agree that using ready packages is better idea. Just please wait for the new version of backend to go live - it will support back history of compilers - so we will have past versions of dmd, ldc, gdc + current ones + nighly builds of all three :) Also the speed and reliability of whole system got really improved. I must admit that attending Dconf, speaking with CyberShadow and so on really got the wheel spinning :) Regards, Damian Ziemba
May 11 2016
parent reply ZombineDev <petar.p.kirov gmail.com> writes:
On Wednesday, 11 May 2016 at 23:12:56 UTC, nazriel wrote:
 On Wednesday, 11 May 2016 at 18:41:12 UTC, ZombineDev wrote:
 [...]
Yeah, I am 100% for open sourcing everything and making it fully non-dependant on me. New version of the backend is already on GH and in the near future (matter of days) it will go live! :) Regarding frontend - I am not sure if I want to release the php version. It is total mess... Small spoiler alert but D+vibed version of fronend is coming very soon and that will be on gh and deployed. stay tuned. Nightly builds... At the moment we have got independant builds of master going on daily basics but I agree that using ready packages is better idea. Just please wait for the new version of backend to go live - it will support back history of compilers - so we will have past versions of dmd, ldc, gdc + current ones + nighly builds of all three :) Also the speed and reliability of whole system got really improved. I must admit that attending Dconf, speaking with CyberShadow and so on really got the wheel spinning :) Regards, Damian Ziemba
I'm very glad to hear that! I hope in future we can merge your efforts with https://github.com/stonemaster/dlang-tour and move to github.com/dlang/ide.dlang.org and ide.dlang.org as Andrei suggested not long ago.
May 12 2016
parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 5/12/16 11:24 AM, ZombineDev wrote:
 I'm very glad to hear that! I hope in future we can merge your efforts
 with https://github.com/stonemaster/dlang-tour and move to
 github.com/dlang/ide.dlang.org and ide.dlang.org as Andrei suggested not
 long ago.
Yes! All, please keep me posted about anything and everything is needed to get this flying. -- Andrei
May 12 2016
prev sibling parent ixid <adamsibson hotmail.com> writes:
On Wednesday, 11 May 2016 at 11:27:44 UTC, nazriel wrote:
 On Tuesday, 10 May 2016 at 16:39:05 UTC, Anonymouse wrote:
 I just had a PEBCAK moment where I was composing a large-ish 
 snippet on dpaste, then accidentally left the page by clicking 
 the back button on my mouse. Going back to the page I see my 
 changes were lost.

 Could we maybe add a warning when leaving the page if the 
 content has been changed? I think it's the onbeforeunload 
 event, but I don't know javascript well.

 http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onbeforeunload_dom
Good idea. I've added it to TODO list here https://github.com/nazriel/dpaste-frontend/issues/3
Could the layout be modified for mobile screens so the compile button appears close to the text entry box? At present the compiler options box goes below the options box and requires a fair bit of scrolling just to hit the compile button. dpaste is a really nice way of playing with minor bits of code on mobile.
May 12 2016
prev sibling parent reply Jack Stouffer <jack jackstouffer.com> writes:
On Tuesday, 10 May 2016 at 16:39:05 UTC, Anonymouse wrote:
 I just had a PEBCAK moment where I was composing a large-ish 
 snippet on dpaste, then accidentally left the page by clicking 
 the back button on my mouse. Going back to the page I see my 
 changes were lost.

 Could we maybe add a warning when leaving the page if the 
 content has been changed? I think it's the onbeforeunload 
 event, but I don't know javascript well.

 http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onbeforeunload_dom
IIRC chrome does this automatically.
May 11 2016
parent Anonymouse <asdf asdf.net> writes:
On Wednesday, 11 May 2016 at 22:18:47 UTC, Jack Stouffer wrote:
 On Tuesday, 10 May 2016 at 16:39:05 UTC, Anonymouse wrote:
 I just had a PEBCAK moment where I was composing a large-ish 
 snippet on dpaste, then accidentally left the page by clicking 
 the back button on my mouse. Going back to the page I see my 
 changes were lost.

 Could we maybe add a warning when leaving the page if the 
 content has been changed? I think it's the onbeforeunload 
 event, but I don't know javascript well.

 http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onbeforeunload_dom
IIRC chrome does this automatically.
This was using Chrome, version 50 or thereabouts. Tested it again now and it doesn't warn.
May 12 2016