Ver Mensaje Individual
  #5 (permalink)  
Antiguo 09/02/2010, 07:06
Avatar de aniMAYtions
aniMAYtions
 
Fecha de Ingreso: diciembre-2007
Ubicación: Granada
Mensajes: 519
Antigüedad: 16 años, 4 meses
Puntos: 2
Respuesta: se puede usar el tinymce sólo en algunos casos?

Bueno, al final accedí a esta página
http://tinymce.moxiecode.com/examples
y encontré muchos y buenos ejemplos para usar el editor Tinymce. Pero al final, después de probar todos los que se adaptaban a mi cometido, he tenido que hacer un pot pourrí de varios y me ha salido el cídigo algo así:

Código:
// Llamada al pulsar el botón que envía el nombre del campo a modificar
if(campo == 'editatitulo')
	{
		setuptitulo();
	}
	else if( campo == 'editacabecera' )
	{
		setupcabecera();
	}
	else if(campo == 'editacuerpo')
	{
		setupcuerpo();
	}

//función setup que llama a los diferentes tinymce que se cargan
function setuptitulo()
{
	tinyMCE.init({
			 mode : "specific_textareas",
			editor_selector : "texttitulo",
			 languaje : "es",
			 theme_advanced_toolbar_location : "top",
			 theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,fontselect,fontsizeselect, |, cut,copy,paste,pastetext,pasteword",
		theme_advanced_buttons2 :"bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor, code,|, forecolor,backcolor, |, hr, removeformat, visualaid, sub,sup",
		theme_advanced_toolbar_align : "left",
	
			 theme : "advanced" 
		  });
};

function setupcabecera()
{
	tinyMCE.init({
			 mode : "specific_textareas",
			editor_selector : "textcabecera",
			 languaje : "es",
			 theme_advanced_toolbar_location : "top",
			 theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,fontselect,fontsizeselect, |, cut,copy,paste,pastetext,pasteword",
		theme_advanced_buttons2 :"bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor, code,|, forecolor,backcolor, |, hr, removeformat, visualaid, sub,sup",
		theme_advanced_toolbar_align : "left",
	
			 theme : "advanced" 
		  });
};

function setupcuerpo()
{
	tinyMCE.init({
			 mode : "specific_textareas",
			editor_selector : "textcuerpo",
			 languaje : "es",
			 theme_advanced_toolbar_location : "top",
			 theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,fontselect,fontsizeselect, |, cut,copy,paste,pastetext,pasteword",
		theme_advanced_buttons2 :"bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor, code,|, forecolor,backcolor, |, hr, removeformat, visualaid, sub,sup",
		theme_advanced_toolbar_align : "left",
	
			 theme : "advanced" 
		  });
};
Se supone que hay formas más sencillas, lo sé, pero después de probar de todo he tenido que pegar ahí un "martillazo" y eso me funciona.

Aunque aún admito ideas para cambiarlo, eh??

Un saludo.