Author |
Topic |
|
Deleted
deleted
4116 Posts |
Posted - 06 October 2002 : 01:36:16
|
As you know, inc_code.asp is converted to inc_code.js, and inc_code.asp is left in the code for compatibility. The reason was to make use of .JS file caching...
On the other hand, in v4, we need to use the dynamic way as the text inside must be rendered dynamically. Here are our options:
- Revert back to ASP and do it as it is in v4b03.x, leave JS in english for compatibility
- Use ASP to create a bunch of JS variables that are to be used in rendering time, also convert ASP file to continue compatibility concerns
Any ideas? < |
Stop the WAR! |
|
Survivor
Starting Member
Russia
10 Posts |
Posted - 07 October 2002 : 07:36:56
|
May be, just some Response.ContentType = "text/js" ?< |
|
|
Deleted
deleted
4116 Posts |
Posted - 07 October 2002 : 08:11:06
|
You mean something like this: http://www.15seconds.com/issue/000811.htm ?
We have one more problem with caching... If the user switches the language will it be taken from the cache or re-generated? < |
Stop the WAR! |
|
|
pweighill
Junior Member
United Kingdom
453 Posts |
Posted - 07 October 2002 : 08:34:44
|
Here's one way, similar to adding lots of JS variables to the main page, but slightly different.
On the main page, add a hidden form with lots of hidden input boxes containing all the prompt text.
e.g.
<form name="jsprompts" action="">
<input type="hidden" name="txtboldhelp" value="Bold Tag Makes the enclosed text bold.\n\nUSE: [b ]This is some bold text[/b]"></input>
<input type="hidden" name="txtboldprompt" value="Text to be made BOLD."></input>
</form>
Then modify the code in the inc_code.js (and asp version).
e.g
function bold() {
var text = getText();
if (helpstat) {
alert(document.jsprompts.txtboldhelp.value);
} else if (basic) {
AddTxt="[b ]" + text + "[/b]";
AddText(AddTxt);
} else {
if (text) {
txt=prompt(document.jsprompts.txtboldprompt.value,text);
} else {
txt=prompt(document.jsprompts.txtboldprompt.value,"Text");
}
if (txt!=null) {
AddTxt="[b ]"+txt+"[/b]";
AddText(AddTxt);
}
}
}
(NOTE: remove the space in all occurences of [b ])< |
|
|
pweighill
Junior Member
United Kingdom
453 Posts |
Posted - 07 October 2002 : 17:54:06
|
quote: Originally posted by bozden
Here are our options:
- Revert back to ASP and do it as it is in v4b03.x, leave JS in english for compatibility
- Use ASP to create a bunch of JS variables that are to be used in rendering time, also convert ASP file to continue compatibility concerns
Any ideas?
3rd option:
- Have another lang file which just contains any text used in the js scripts and then include in the asp page: <script ... src="lang_nnn.js"></script>
< |
|
|
Survivor
Starting Member
Russia
10 Posts |
Posted - 09 October 2002 : 01:57:41
|
No, there are will be problem with caching ... It must be forced to reload js-file after changing language...< |
|
|
Deleted
deleted
4116 Posts |
Posted - 09 October 2002 : 02:06:09
|
quote: Originally posted by Survivor
No, there are will be problem with caching ... It must be forced to reload js-file after changing language...
How to do this? Also taking any intermediate proxies into account...< |
Stop the WAR! |
|
|
e3stone
Average Member
USA
885 Posts |
Posted - 09 October 2002 : 11:09:49
|
can't we just set it where no caching is available? i.e. <meta http-equiv="pragma" content="no-cache"> ?< |
<-- Eric --> |
|
|
Survivor
Starting Member
Russia
10 Posts |
Posted - 09 October 2002 : 11:13:52
|
In one case, we need caching, but from second case - don't... Hmm....< |
|
|
Survivor
Starting Member
Russia
10 Posts |
Posted - 09 October 2002 : 11:17:46
|
May be, this caching can works only with one language on forum, without changing option...< |
|
|
Deleted
deleted
4116 Posts |
Posted - 09 October 2002 : 13:38:51
|
The only other way (I can think of) of using caching & dynamic use in this case is to generate inc_codeNNNN.js files, but this is also out of question because then we need one more file to distribute in the language file.
Perhaps the easiest/best way is to generate the global JS variables in post.asp only... The JS file will be cached and it will be dynamic wrt the text it shows. < |
Stop the WAR! |
|
|
|
Topic |
|