I didn't have had a detailed look at the script, but after an extremely quick glance I saw you use a function called
addslashes(). That function can be done extremely shorter:
code:
//Adds slashes before special characters of regular expressions
function addslashes(str) {
return str.replace(/(\W)/g,'\\$1')
}
I'm sure other optimizations can be done.... However, as it is now, this is the best countdown for Live I've seen.
----------------
Another thing (rather important) you want to implement (but it will require recoding major parts): If a tag is not used, the value should be incoorperated with the tags that are used.
This means, for example, when you have:
%d days %h hours %n minutes => 2 days 5 hours 3 minutes
and you leave out the days tag it should become:
%h hours %n minutes =>
53 hours 3 minutes
----------------
Suggestions (mostly GUI related):
- Update interval must be 15 seconds (or even higher) or higher
- The countdown tag is restricted in size, remove that
- Wrong wording in "reset my psm when countdown is activated" ? (=> 'activated' must be 'deactivated').
- The nickname checkbox is too close to the psm checkbox. psm checkbox might need more space too for other translations.
- The menu after the countdown tag combobox is good, but seems a bit strange that it pops up. One could expect it to pop down. (dunno if this is intended or if this is Plus!'s doing)
- Change the wording "countdown tag" to "tag" or "(!CD) tag" (or let it also update to countup when a date in the past is selected)
- Make it possible to use \n (new line) and \t (tab) in translation texts.
- Even if same language is selected and one presses ok or apply, read the file again and apply the new translations (very usefull for translators).
- If an error needs to be shown (eg: the interval is too low) do it in a messagebox, not a toast
- I would change the order of the context menu to:
1) activate
2) refresh
3) -----------
4) options
5) About
6) --------
7) check for updates
in anyways, putting options before check for updates as options is more important and more used (the check for updates isn't needed in the menu though imho, as it is available in the options screen already)
----------------
Also, here is a correction for the Dutch language (some things corrected, other things replaced so it closer matches Plus!'s translation).
And also the English language (also with some stuff fixed as listed above)