[Paulscriptsmods-checkin] ajax_shout/root ajax.php, 1.21.2.32, 1.21.2.33 bbcode.js, 1.3, 1.3.2.1
Status: Beta
Brought to you by:
paulsohier
From: Paul S. <pau...@us...> - 2007-09-23 21:03:31
|
Update of /cvsroot/paulscriptsmods/ajax_shout/root In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16568/root Modified Files: Tag: phpbb3_ver ajax.php bbcode.js Log Message: More changes. Index: ajax.php =================================================================== RCS file: /cvsroot/paulscriptsmods/ajax_shout/root/ajax.php,v retrieving revision 1.21.2.32 retrieving revision 1.21.2.33 diff -C2 -d -r1.21.2.32 -r1.21.2.33 *** ajax.php 23 Sep 2007 20:43:44 -0000 1.21.2.32 --- ajax.php 23 Sep 2007 21:03:33 -0000 1.21.2.33 *************** *** 227,231 **** el.className = 'inputbox'; ! el.name = el.id = 'bericht'; el.style.width = '325px'; --- 227,231 ---- el.className = 'inputbox'; ! el.name = el.id = 'message'; el.style.width = '325px'; *************** *** 281,285 **** document.getElementById('msg_txt').appendChild(tn('<?php echo $user->lang['SENDING']; ?>')); ! if (document.getElementById('bericht').value == '') { document.getElementById('msg_txt').innerHTML = ''; --- 281,285 ---- document.getElementById('msg_txt').appendChild(tn('<?php echo $user->lang['SENDING']; ?>')); ! if (document.getElementById('message').value == '') { document.getElementById('msg_txt').innerHTML = ''; *************** *** 319,323 **** setTimeout('last = 0;', 500); } ! document.getElementById('bericht').focus(); } } --- 319,323 ---- setTimeout('last = 0;', 500); } ! document.getElementById('message').focus(); } } *************** *** 330,336 **** post = 'message='; ! post += encodeURIComponent(document.getElementById('bericht').value); ! document.getElementById('bericht').value = ''; if (smilies == true) --- 330,336 ---- post = 'message='; ! post += encodeURIComponent(document.getElementById('message').value); ! document.getElementById('message').value = ''; if (smilies == true) *************** *** 414,418 **** a.onclick = function() { ! document.getElementById('bericht').value += " " + this.code + " "; } --- 414,418 ---- a.onclick = function() { ! document.getElementById('message').value += ' ' + this.code + ' '; } *************** *** 563,567 **** { echo 'post.style.height = \'160px\'; ! post.style.overflow = \'auto\';''; } ?> --- 563,567 ---- { echo 'post.style.height = \'160px\'; ! post.style.overflow = \'auto\';'; } ?> *************** *** 1380,1384 **** } <?php ! die; } switch ($mode) --- 1380,1384 ---- } <?php ! exit; } switch ($mode) *************** *** 1408,1412 **** } echo '</xml>'; ! die; } else --- 1408,1412 ---- } echo '</xml>'; ! exit; } else *************** *** 1421,1425 **** { echo '<error>' . $user->lang['NO_SHOUT_ID'] . '</error></xml>'; ! die; } else --- 1421,1425 ---- { echo '<error>' . $user->lang['NO_SHOUT_ID'] . '</error></xml>'; ! exit; } else *************** *** 1434,1438 **** { echo '<msg></msg></xml>'; ! die; } } --- 1434,1438 ---- { echo '<msg></msg></xml>'; ! exit; } } *************** *** 1473,1477 **** { echo '<error>' . $user->lang['FLOOD_ERROR'] . '</error></xml>'; ! die; } } --- 1473,1477 ---- { echo '<error>' . $user->lang['FLOOD_ERROR'] . '</error></xml>'; ! exit; } } *************** *** 1487,1496 **** { echo '<error>' . $user->lang['MESSAGE_EMPTY'] . '</error></xml>'; ! die; } else if (strpos($message, '[quote') !== false || strpos($message, '[code') !== false || strpos($message, '[list') !== false) { echo '<error>' . $user->lang['NO_QUOTE'] . '</error></xml>'; ! die; } else --- 1487,1496 ---- { echo '<error>' . $user->lang['MESSAGE_EMPTY'] . '</error></xml>'; ! exit; } else if (strpos($message, '[quote') !== false || strpos($message, '[code') !== false || strpos($message, '[list') !== false) { echo '<error>' . $user->lang['NO_QUOTE'] . '</error></xml>'; ! exit; } else *************** *** 1517,1521 **** } echo '<msg>' . $user->lang['POSTED'] . '</msg></xml>'; ! die; } } --- 1517,1521 ---- } echo '<msg>' . $user->lang['POSTED'] . '</msg></xml>'; ! exit; } } *************** *** 1536,1540 **** $s = $row['s']; echo "<last>$s</last><tijd>" . (int)($s != $last) . '</tijd></xml>'; ! die; } break; --- 1536,1540 ---- $s = $row['s']; echo "<last>$s</last><tijd>" . (int)($s != $last) . '</tijd></xml>'; ! exit; } break; *************** *** 1550,1554 **** $row = (int)$row['nr']; echo "<nr>$row</nr></xml>"; ! die; break; --- 1550,1554 ---- $row = (int)$row['nr']; echo "<nr>$row</nr></xml>"; ! exit; break; *************** *** 1572,1576 **** { echo '<error>' . $user->lang['NO_MESSAGE'] . '</error></xml>'; ! die; } --- 1572,1576 ---- { echo '<error>' . $user->lang['NO_MESSAGE'] . '</error></xml>'; ! exit; } *************** *** 1609,1613 **** } echo '</xml>'; ! die; } break; --- 1609,1613 ---- } echo '</xml>'; ! exit; } break; *************** *** 1668,1672 **** $err = xml($err['message']); echo "<error>$err</error>\n<sql>$sql</sql>\n</xml>"; ! die; } --- 1668,1672 ---- $err = xml($err['message']); echo "<error>$err</error>\n<sql>$sql</sql>\n</xml>"; ! exit; } Index: bbcode.js =================================================================== RCS file: /cvsroot/paulscriptsmods/ajax_shout/root/bbcode.js,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** bbcode.js 28 Jan 2007 15:40:09 -0000 1.3 --- bbcode.js 23 Sep 2007 21:03:33 -0000 1.3.2.1 *************** *** 28,36 **** // Replacement for arrayname.length property ! function getarraysize(thearray) { ! for (i = 0; i < thearray.length; i++) { if ((thearray[i] == "undefined") || (thearray[i] == "") || (thearray[i] == null)) return i; } return thearray.length; } --- 28,40 ---- // Replacement for arrayname.length property ! function getarraysize(thearray) ! { ! for (i = 0; i < thearray.length; i++) ! { if ((thearray[i] == "undefined") || (thearray[i] == "") || (thearray[i] == null)) + { return i; } + } return thearray.length; } *************** *** 38,42 **** // Replacement for arrayname.push(value) not implemented in IE until version 5.5 // Appends element to the array ! function arraypush(thearray,value) { thearray[ getarraysize(thearray) ] = value; } --- 42,47 ---- // Replacement for arrayname.push(value) not implemented in IE until version 5.5 // Appends element to the array ! function arraypush(thearray,value) ! { thearray[ getarraysize(thearray) ] = value; } *************** *** 44,48 **** // Replacement for arrayname.pop() not implemented in IE until version 5.5 // Removes and returns the last element of an array ! function arraypop(thearray) { thearraysize = getarraysize(thearray); retval = thearray[thearraysize - 1]; --- 49,54 ---- // Replacement for arrayname.pop() not implemented in IE until version 5.5 // Removes and returns the last element of an array ! function arraypop(thearray) ! { thearraysize = getarraysize(thearray); retval = thearray[thearraysize - 1]; *************** *** 51,68 **** } ! function bbfontstyle(bbopen, bbclose) { ! if ((clientVer >= 4) && is_ie && is_win) { theSelection = document.selection.createRange().text; ! if (!theSelection) { ! document.getElementById('bericht').value += bbopen + bbclose; ! document.getElementById('bericht').focus(); return; } document.selection.createRange().text = bbopen + theSelection + bbclose; ! document.getElementById('bericht').focus(); return; ! } else { ! document.getElementById('bericht').value += bbopen + bbclose; ! document.getElementById('bericht').focus(); return; } --- 57,79 ---- } ! function bbfontstyle(bbopen, bbclose) ! { ! if ((clientVer >= 4) && is_ie && is_win) ! { theSelection = document.selection.createRange().text; ! if (!theSelection) ! { ! document.getElementById('message').value += bbopen + bbclose; ! document.getElementById('message').focus(); return; } document.selection.createRange().text = bbopen + theSelection + bbclose; ! document.getElementById('message').focus(); return; ! } ! else ! { ! document.getElementById('message').value += bbopen + bbclose; ! document.getElementById('message').focus(); return; } *************** *** 70,97 **** ! function bbstyle(bbnumber) { donotinsert = false; bblast = 0; ! if(document.getElementById('bericht').value == document.getElementById('bericht').begin) { ! document.getElementById('bericht').value = ' '; } ! if (bbnumber == -1) { // Close all open tags & default button names ! while (bbcode[0]) { butnumber = arraypop(bbcode) - 1; ! document.getElementById('bericht').value += bbtags[butnumber + 1]; buttext = eval('document.getElementById(\'addbbcode' + butnumber + '\').value'); eval('document.getElementById(\'addbbcode' + butnumber + '\').value ="' + buttext.substr(0,(buttext.length - 1)) + '"'); } imageTag = false; // All tags are closed including image tags :D ! document.getElementById('bericht').focus(); return; } // Find last occurance of an open tag the same as the one just clicked ! for (i = 0; i < bbcode.length; i++) { ! if (bbcode[i] == bbnumber+1) { bblast = i; donotinsert = true; --- 81,113 ---- ! function bbstyle(bbnumber) ! { donotinsert = false; bblast = 0; ! if(document.getElementById('message').value == document.getElementById('message').begin) { ! document.getElementById('message').value = ' '; } ! if (bbnumber == -1) ! { // Close all open tags & default button names ! while (bbcode[0]) ! { butnumber = arraypop(bbcode) - 1; ! document.getElementById('message').value += bbtags[butnumber + 1]; buttext = eval('document.getElementById(\'addbbcode' + butnumber + '\').value'); eval('document.getElementById(\'addbbcode' + butnumber + '\').value ="' + buttext.substr(0,(buttext.length - 1)) + '"'); } imageTag = false; // All tags are closed including image tags :D ! document.getElementById('message').focus(); return; } // Find last occurance of an open tag the same as the one just clicked ! for (i = 0; i < bbcode.length; i++) ! { ! if (bbcode[i] == bbnumber+1) ! { bblast = i; donotinsert = true; *************** *** 99,116 **** } ! if (donotinsert) { // Close all open tags up to the one just clicked & default button names ! while (bbcode[bblast]) { butnumber = arraypop(bbcode) - 1; ! document.getElementById('bericht').value += bbtags[butnumber + 1]; buttext = eval('document.getElementById(\'addbbcode' + butnumber + '\').value'); eval('document.getElementById(\'addbbcode' + butnumber + '\').value ="' + buttext.substr(0,(buttext.length - 1)) + '"'); imageTag = false; } ! document.getElementById('bericht').focus(); return; ! } else { // Open tags ! if (imageTag && (bbnumber != 6)) { // Close image tag before adding another ! document.getElementById('bericht').value += bbtags[7]; lastValue = arraypop(bbcode) - 1; // Remove the close image tag from the list document.getElementById('addbbcode6').value = "Img"; // Return button back to normal state --- 115,137 ---- } ! if (donotinsert) ! { // Close all open tags up to the one just clicked & default button names ! while (bbcode[bblast]) ! { butnumber = arraypop(bbcode) - 1; ! document.getElementById('message').value += bbtags[butnumber + 1]; buttext = eval('document.getElementById(\'addbbcode' + butnumber + '\').value'); eval('document.getElementById(\'addbbcode' + butnumber + '\').value ="' + buttext.substr(0,(buttext.length - 1)) + '"'); imageTag = false; } ! document.getElementById('message').focus(); return; ! } ! else ! { // Open tags ! if (imageTag && (bbnumber != 6)) ! { // Close image tag before adding another ! document.getElementById('message').value += bbtags[7]; lastValue = arraypop(bbcode) - 1; // Remove the close image tag from the list document.getElementById('addbbcode6').value = "Img"; // Return button back to normal state *************** *** 119,127 **** // Open tag ! document.getElementById('bericht').value += bbtags[bbnumber]; if ((bbnumber == 6) && (imageTag == false)) imageTag = 1; // Check to stop additional tags after an unclosed image tag arraypush(bbcode,bbnumber+1); eval('document.getElementById(\'addbbcode'+bbnumber+'\').value += "*"'); ! document.getElementById('bericht').focus(); return; } --- 140,148 ---- // Open tag ! document.getElementById('message').value += bbtags[bbnumber]; if ((bbnumber == 6) && (imageTag == false)) imageTag = 1; // Check to stop additional tags after an unclosed image tag arraypush(bbcode,bbnumber+1); eval('document.getElementById(\'addbbcode'+bbnumber+'\').value += "*"'); ! document.getElementById('message').focus(); return; } |