Archived
1
0

x fixed endless loop when pretxt was empty (IE: "Script is busy"-message)

This commit is contained in:
mbirth 2007-04-26 09:41:22 +00:00
parent 0e37126422
commit 35438d6d53
3 changed files with 9 additions and 3 deletions

View File

@ -4,7 +4,7 @@
<name>SMF Shoutbox</name> <name>SMF Shoutbox</name>
<id>Deep:SMF_Shoutbox</id> <id>Deep:SMF_Shoutbox</id>
<type>modification</type> <type>modification</type>
<version>1.15b</version> <version>1.16</version>
<install for="1.1, 1.1.1, 1.1.2, 1.1.3"> <install for="1.1, 1.1.1, 1.1.2, 1.1.3">
<require-file name="sbox.php" destination="$sourcedir" /> <require-file name="sbox.php" destination="$sourcedir" />
@ -98,6 +98,10 @@ PLEASE UNINSTALL ANY LANGUAGE PACK FOR SHOUTBOX BEFORE UPGRADING!]]></readme>
<require-file name="sbox.french.php" destination="$languagedir" /> <require-file name="sbox.french.php" destination="$languagedir" />
<require-file name="sbox.template.php" destination="$themedir" /> <require-file name="sbox.template.php" destination="$themedir" />
</upgrade> </upgrade>
<upgrade from="1.15b" for="1.1, 1.1.1, 1.1.2, 1.1.3">
<readme type="inline"><![CDATA[Thanks for trying the shiny new update feature. Although the Package manager might show you an error, the upgrade should work.]]></readme>
<require-file name="sbox.template.php" destination="$themedir" />
</upgrade>
<uninstall for="1.1, 1.1.1, 1.1.2, 1.1.3"> <uninstall for="1.1, 1.1.1, 1.1.2, 1.1.3">
<readme type="inline">Uninstall will remove all the changes made by the shoutbox.</readme> <readme type="inline">Uninstall will remove all the changes made by the shoutbox.</readme>

View File

@ -41,9 +41,11 @@ function template_shout_box() {
prelen = pretxt.length; prelen = pretxt.length;
xval = document.sbox.sboxText.value; xval = document.sbox.sboxText.value;
if (xval.toLowerCase() == pretxt.toLowerCase()) return false; if (xval.toLowerCase() == pretxt.toLowerCase()) return false;
while (xval.toLowerCase().indexOf(pretxt.toLowerCase()) >= 0) { ctr = 0;
while (xval.toLowerCase().indexOf(pretxt.toLowerCase()) >= 0 && ctr < 8) {
xpos = xval.toLowerCase().indexOf(pretxt.toLowerCase()); xpos = xval.toLowerCase().indexOf(pretxt.toLowerCase());
xval = xval.substring(0, xpos) + xval.substring(xpos+prelen, xval.length); xval = xval.substring(0, xpos) + xval.substring(xpos+prelen, xval.length);
ctr++;
} }
document.sbox.sboxText.value = xval; document.sbox.sboxText.value = xval;
setTimeout(\'clearSbox()\', 500); setTimeout(\'clearSbox()\', 500);

View File

@ -17,7 +17,7 @@
<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/"> <modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
<!-- This information needs to be the same as that in the package-info.xml. --> <!-- This information needs to be the same as that in the package-info.xml. -->
<id>Deep:SMF_Shoutbox</id> <id>Deep:SMF_Shoutbox</id>
<version>1.15</version> <version>1.16</version>
<!-- Edit BoardIndex.template.php in the SMF Default Theme. --> <!-- Edit BoardIndex.template.php in the SMF Default Theme. -->
<file name="$themedir/BoardIndex.template.php"> <file name="$themedir/BoardIndex.template.php">