Jun. 12th, 2012

dunvi: blue (Default)
[personal profile] dunvi
I was looking at two seemingly similar bugs: bug 3838 and bug 3839, both of which have to do with breaking out JS (and in the case of 3838 CSS) from BML pages.

There was some talk of possibly porting the whole thing to the TT, but, gotta say, there are probably easier ones to start learning TT on!

Anyway. 3838 went fine - easy enough to remove the JS and CSS and move them into their own files. 3839 is a different story. Though the two look very similar, the way the JS is both implemented and then used is very different, and after a lot of thinking and futzing around, I have come to the conclusion that I cannot simply move the JS to a different file and tell the BML file where to find the JS.

In both cases, the JS is looking for information in the associated .text file. In 3838, this isn't important, because what the JS did was generate the HTML to be inserted into the page, which means that the perl inside still had a chance to be read properly. In 3839, the JS is causing actual events - for example, pop-ups asking you to input a name.

I guess there's several ways, then, to 'solve' this particular page. The easiest one is to leave it be and say "The javascript's just stuck". The hacky solution is to alter three of the javascript functions so that they take in some inputs, pre-gather the information from the .text file, and pass it to the javascript functions. Perhaps the correct answer is to rewrite the JS entirely, at which point I would say "Teach me how to convert this to TT".

Surely this problem has been encountered before?

Profile

dw_dev: The word "develop" using the Swirly D logo.  (Default)
Dreamwidth Open Source Development

June 2025

S M T W T F S
1234567
89101112 1314
15161718192021
22232425262728
2930     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 17th, 2025 08:30 am
Powered by Dreamwidth Studios