antiblock
Elveron
  • Chatbox

    You don't have permission to chat.
    Load More
Sign in to follow this  
Ŧá๒i๏ รilvค™

Editor De Textos Com Tinymce

4 posts in this topic

Boas,

Aposto que muitas pessoas queriam ter um editor de textos como o do joomla, wordpress ...

Eu pelo menos queria até ter encontrado este script em javascript que quase todos usam.

Esse script chama-se tinymce. <--!Download!-->

Façam o download do development package e extraiam.

Depois vamos traduzir para Português, vão a este link, escolham portuguese e façam o Download, logo depois extraindo.

Pasta do tiny->jscripts->tiny_mce->langs , ai colem a tradução pt.js.

Agora vamos fazer a função dele, criem um js com o nome de tinymce_func.js e metam lá o seguinte código:

tinyMCE.init({

// General options

mode : "textareas",

theme : "advanced",

language : "pt",

plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",

// Theme options

theme_advanced_buttons1 :"pastetext,pasteword,|,bullist,numlist,|,bold,italic,underline,blockquote,|,justifyleft,justifycenter,justifyright,fontselect,fontsizeselect,",

theme_advanced_buttons2 : "undo,redo,|,link,unlink,image,code,|,preview,|,forecolor,backcolor,|,removeformat, fullscreen",

theme_advanced_buttons3 : "",

theme_advanced_toolbar_location : "top",

theme_advanced_toolbar_align : "left",

theme_advanced_statusbar_location : "bottom",

theme_advanced_resizing : true,

// Example content CSS (should be your site CSS)

content_css : "css/content.css",

// Drop lists for link/image/media/template dialogs

template_external_list_url : "lists/template_list.js",

external_link_list_url : "lists/link_list.js",

external_image_list_url : "lists/image_list.js",

media_external_list_url : "lists/media_list.js",

// Style formats

style_formats : [

{title : 'Bold text', inline : 'b'},

{title : 'Red text', inline : 'span', styles : {color : '#ff0000'}},

{title : 'Red header', block : 'h1', styles : {color : '#ff0000'}},

{title : 'Example 1', inline : 'span', classes : 'example1'},

{title : 'Example 2', inline : 'span', classes : 'example2'},

{title : 'Table styles'},

{title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}

],

// Replace values for the template plugin

template_replace_values : {

username : "Some User",

staffid : "991234"

}

});

Vão ao vosso site e façam os includes:

<scripttype="text/javascript"src="tinymce/jscripts/tiny_mce/tiny_mce.js"></script>

<script type="text/javascript" src="tinymce_func.js"></script>

Agora todas as textareas que estiverem com header que tem este include ficão assim:

Imagem colocada

Cumpz, Fábio

Gostaste ou ajudei-te?

Então retribui com http://cyber-gamers.org/public/style_emoticons/default/451960.gif

Share this post


Link to post
Share on other sites
antiblock
Cyphriun

Mais um excelente tópico, nunca falhas mano e ainda bem que fazes estes tópicos pois vao me dar bastante jeito, e claro como nao era de faltar... tens http://cyber-gamers.org/public/style_emoticons/default/451960.gif

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this