OK, we can reduce th size significantly if we use a function to build up the array of function names, like:

addWithPrefix("cdpf_set_", new Array(
"action_url",
"char_spacing",
"creator",
"current_page",
"font",
"font_directories",
"font_map_file",
"horiz_scaling",
"keywords",
"leading",
"page_animation",
"subject",
"text_matrix",
"text_pos",
"text_rendering",
"text_rise",
"title",
"viewer_preferences",
"word_spacing"));

This might not be the correct JS sytnax, but you can get it. We only use the cpdf_set_ prefix once instead of multiple times (all these function names start with that prefix).

We need to make this prefix optimization automated if we would like to generate small files, so some PHP code can decide on what functions to add with this prefix trick. This does not mean that PHP will generate the JS on the fly. It can be generated on the rsync server to a static file. It will be updated if the function list changes.

Would someone have some motivation to look into this prefix optimization (or any other size decrease ideas for that matter)? I beleive we can significantly reduce the size of the JS this way.

Well spoted! I'll have a look.

Great!


We also need to set up some DHTML to allow ppl to pick up a function finded by the search engine.
> Any opinion regarding this part ?

I'm thinking of implementing a <div> above the text field that will be acceeded by arrow keys while typing the seeked function name. (like in a mailer for example when you start typing the recipient name).

Yes. And it would be nice to be able to press some button to autocomplete the function name while you are close to the end :) Or if there was only one function left in the list and you press enter then that function name would be used to display a manual page.


Goba

Reply via email to