Pequeño problema con MOD: Live Preview 1.0.2
Publicado: 08 May 2011, 12:46
por Gabriel Grey
- Hoy he instalado el mod [url=http://www.phpbb-es.com/foro/descarga-mods-phpbb3/live-preview-v-1-0-2-t29986.html]Live Preview 1.02[/url] en mi foro y funciona bien, excepto en algunos detalles.
[tab=30]Antes que nada tengo que decir que yo desde hace tiempo tengo instalado un mod llamado "Character Countdown 0.0.3" el cual hace algún cambio en el posting_editor.
[tab=30]El Character Countdown 0.0.3 es un mod muy simple que os pongo aquí:
[spoil][b]Find[/b]
[code]onkeyup="storeCaret(this);" class="inputbox">{MESSAGE}{DRAFT_MESSAGE}{SIGNATURE}</textarea></div>[/code]
[b]Replace with[/b]
[code]onpaste="storeCaret(this); var tb = this; setTimeout(function() {document.getElementById('charsLength').innerHTML = 'Characters typed: ' + tb.value.length}, 10);" onkeyup="storeCaret(this); document.getElementById('charsLength').innerHTML = 'Characters typed: ' + this.value.length;" class="inputbox">{MESSAGE}{DRAFT_MESSAGE}{SIGNATURE}</textarea>
</div>
<div style="height:10px" id="charsLength">Characters typed: 0</div>
<script type="text/javascript">
function getElm(eID) {
return document.getElementById(eID);
}
setTimeout(function(){
document.getElementById('charsLength').innerHTML = 'Characters typed: ' + document.getElementsByName('message')[0].value.length;
}, 500);
function showLength(eID, rID) {
getElm(rID).innerHTML = getElm(eID).value.length;
}
</script>[/code][/spoil]
[tab=30]Este mod sirve para mostrar un contador de carácteres a la hora de escribir un mensaje. Bien.
[tab=30]Hoy he instalado el mod [url=http://www.phpbb-es.com/foro/descarga-mods-phpbb3/live-preview-v-1-0-2-t29986.html]Live Preview 1.02[/url] y he tenido que adaptar un poco las líneas para que funcionaran los dos mods a la vez. Finalmente mi posting_editor ha quedado así:
[code] <div id="message-box">
<textarea <!-- IF S_UCP_ACTION and not S_PRIVMSGS and not S_EDIT_DRAFT -->name="signature" id="signature" style="height: 9em;"<!-- ELSE -->name="message" id="message"<!-- ENDIF --> rows="15" cols="76" tabindex="4" onselect="storeCaret(this);" onclick="storeCaret(this);" onfocus="initInsertions();"
onpaste="storeCaret(this); var tb = this; setTimeout(function() {document.getElementById('charsLength').innerHTML = 'Máximo: 50000. Carácteres totales: ' + tb.value.length}, 10);" onkeyup="storeCaret(this);forceScrollBottom('livepreview');" onkeydown="forceScrollBottom('livepreview'); document.getElementById('charsLength').innerHTML = 'Máximo: 50000. Carácteres totales: ' + this.value.length;" class="inputbox">{MESSAGE}{DRAFT_MESSAGE}{SIGNATURE}</textarea>
</div>
<div style="height:10px" id="charsLength">Máximo: 50000. Carácteres totales: 0</div>
<script type="text/javascript">
function getElm(eID) {
return document.getElementById(eID);
}
setTimeout(function(){
document.getElementById('charsLength').innerHTML = 'Máximo: 50000. Carácteres totales: ' + document.getElementsByName('message')[0].value.length;
}, 500);
function showLength(eID, rID) {
getElm(rID).innerHTML = getElm(eID).value.length;
}
</script>
</fieldset>[/code]
[tab=30]Y, funciona, salvo por un error que es muy molesto. Una vez escrito el mensaje, se muestra una segunda ventana de aceptar que desaparece a los 2 segundos. Os pongo una captura:
[thumbnail=center]http://img691.imageshack.us/img691/4286/capturadgi.jpg[/thumbnail]
[tab=30]¿Cómo se puede solucionar esto?
[tab=30]Gracias.