Skip to content

Instantly share code, notes, and snippets.

@pontikis
Created July 26, 2011 14:39
Show Gist options
  • Save pontikis/1106910 to your computer and use it in GitHub Desktop.
Save pontikis/1106910 to your computer and use it in GitHub Desktop.
tinymce in a nutshell
# /.idea
/.idea/*
/**
* Created by Christos Pontikis
* LICENSE: GNU General Public License (http://www.gnu.org/copyleft/gpl.html)
*
* quick and dirty guide to TinyMCE (http://tinymce.moxiecode.com)
*
*/
TinyMCE: probably the best Javascript WYSIWYG Editor
http://tinymce.moxiecode.com/
Download TinyMCS (jQuety package preferrable) http://tinymce.moxiecode.com/download/download.php
Extract somewhere in web server
Buy MCIFilemanager http://tinymce.moxiecode.com/enterprise/mcfilemanager.php
Extract to plugins directory
Download language packs and extract them where tinymce is located
Languages for "tinymce"
http://tinymce.moxiecode.com/i18n/index.php?ctrl=lang&act=download&pr_id=1
Languages for "MCFileManager"
http://tinymce.moxiecode.com/i18n/index.php?ctrl=lang&act=index&pr_id=2
MCIFilemanage authentication: add a line like $_SESSION['isLoggedIn'] = true; to your login script
Configure filemanager config.php
$(function() {
$("#textarea_id").tinymce({
// Location of TinyMCE script
script_url : $("#project_url").val() + '/lib/ext/tiny_mce_jquery_v.3.4.3.2/tiny_mce.js',
// General options
theme : "advanced",
plugins : "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,filemanager",
language : $("#lang").val(),
relative_urls : false,
entity_encoding : "raw",
// Theme options
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
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 : $("#project_url").val() + '/css/filename.css'
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment