PEAK XOOPS - Re: Integrating TinyMCE editor in englishin japanese

Re: Integrating TinyMCE editor

List posts in the topic

question Re: Integrating TinyMCE editor

msg# 1.1.1
depth:
2
Previous post - Next post | Parent - No child | Posted on 2005/4/30 2:11
raqxx  二等兵   Posts: 1
hi all
thanks for the module gijoe, I really like it.
I like to implement TinyMCE editor or any cross browser editor, it looks like TinyMCE is the easiest to do for people like me with no php knowledge. One very stupid question where is the directory /common to apply ap1239 hack ?

Quote:
1)download TinyMCE and copy its jscript directory to /common

also there is some instruccions with TinyEditor how to implement it in modules, but i'm very much lost. Has anyone done it?

Quote:
### Installation ###
Install Tinyeditor the way you do with
other xoops modules,then set the module's
preferences.

### Image manager functionalities ###
The image manager plugin features now a
thumbnail-to-popup function which enables you
to automatically add a link to view the full-size
image from its thumbnail.
To do so,you MUST enable Javascript code
in /xoops/class/module.textsanitizer.php file
since Xoops filters javascript code for security
purposes.
I obviously suggest you to do so either
if you are the only submitter of your site
or you have trusted contributors.
When decided,open
/xoops/class/module.textsanitizer.php
with your test editor and comment
lines 200 and 201
so they become
//$patterns[] = "/java script:/si";
//$replacements[] = "java script:";
After this you have to add the js code so open
/xoops/include/xoops.js
with your test editor and add the following
at the very top of the file:

____________START__COPY/CUT BELOW__________________


function myPopImage(imageURL,imageTitle) {

// Script Source: CodeLifter.com

//Set this values 20px larger
//than your biggest picture
PositionX = 100;
PositionY = 100;

defaultWidth = 680;
defaultHeight = 520;

var AutoClose = true;

// Do not edit below this line...

if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
if (isNN){imgWin=window.open('about :blank','',optNN);}
if (isIE){imgWin=window.open('about :blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor="FFFFFF" scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor="FFFFFF" scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()" onClick="self.close()">');
writeln('<img name="George" alt="Clicca per chiudere" src='+imageURL+' style="display:block"></body></html>');
close();
}
}

__________STOP__COPY/CUT_______________________

You're done!

### How to use TinyEditor within other modules ###
TinyEditor now comes with a built-in class which makes
integration within other modules really QUICK and EASY.
An example of integration into News 1.2.1

1)Open /modules/news/include/storyform.inc.php
with your text editor and go to line 32;
Right below add:
include_once XOOPS_ROOT_PATH . "/modules/tinyeditor/formtinytextarea.php";

2)Then replace the original code which renders the textareas with TinyEditor instances;
so comment or remove line 61
$sform->addElement(new XoopsFormDhtmlTextArea(_NW_THESCOOP, 'hometext', $hometext, 15, 60, 'hometext_hidden'), true);
and add
$sform->addElement(new XoopsFormTinyTextArea( _NW_THESCOOP, 'hometext', $hometext, '100%', '300px'), true);
for hometext and
$sform->addElement(new XoopsFormTinyTextArea( _AM_EXTEXT, 'bodytext', $bodytext, '70%', '400px'), true);
for bodytext.
That's all!!!

You can easily adapt these instructions with other Xoops modules.


if you know of any info about how to do it or know of any links with more info, very much appreciate
thanks,
raqxx
Votes:2 Average:0.00

Posts tree

  Advanced search


Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!