Rob's Ramblings

Monday 10 April 2017

Retrochallenge Day 2.. er... 8 ..er .. 10

Blimey, has it been a week already?

OK.  I've not done much coding since last time, but I have been reading code and daydreaming planning out my next move.

Now Javascript is not my strongest language.  I can read it, and modify it, but actually writing new code is a bit of a challenge.  Part of the rationale behind this task was to get myself a bit more familiar with this hideously back to front language...

The teletext browser I used is that created by Adam Dawes based on Simon Rawles (et..al.) edit.tf editor, and grabbed from Jason's captures at uniquecodeanddata.co.uk.  The modifications are to add a pile of new functions, and truncate and or redirect others.

As the original editor has moved on somewhat since this was done, it seems logical that, if I want to do more mods to it, then i should base my code on the latest version.  If I can do it in such a way that I do not need to actually modify the editor, just call it, then that would be best.   In PHP I would, assuming it was a class, extend the class in a new file and override the relevant functions.  So... How to do this in Javascript...

I tried using prototypes ... but hit the problem that the editor is written with lots of private variables and functions, which the new functions in the viewer refer to.  Using the existing editor as the viewer's prototype doesn't work because it cannot access the private variables.  Drat.

<days pass>

After spending more time than I ever expected looking at javascript objects, inheritances, etc., I have decided not to commit myself to ever having to do anything major in this language!!

Sticking with Javascript, I think the best approach at this point would, after all, be to fork edit.tf and modify it to separate out the actual display part from the editor part, that way I can provide for a viewer, indeed, different viewers...  Might even be a mod Simon would like...

Sigh.  Bloody Javascript.

The other option would be to go back to my own viewdata viewer class, which runs serverside to create the images.  I understand this, but I was hoping not to have to do this, as it makes updating the "screen" with the page number being keyed dependant on the server, rather than being local.


So, ten days in, and all I've achieved is discovering that what I thought would be a simple task is much more complicated than I thought it would be.



Labels: , , , , ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]



<< Home