473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Installing TinyMCE Help

Hi all,
I have difficulties initializing TinyMCE. Initialization involved 1
included file tiny_mce.js and one which I include "on demand" (see
tinyMCEOnDemand()). The content of that function is all the way below.
If I do not "demand" that file but, rather, write locally, everything
works smoothly with included file tiny_mce.js. But my HTML object
required for initialization appears on the page when user decides to
make it appear, therefore TinyMCE cannot be initialized until a
necessary html object is visible (i.e. textarea). I wrote function
start() to simulate this process of my needs. As a result, I suffer
running the code below.
Can anyone suggest something?

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>My example</title>
<!-- tinyMCE -->

<script language="javascript" type="text/javascript" src="../jscripts/
tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
function start(){
var body = document.getElementsByTagName("body")[0];
var d = document.createElement('div');
d.style.display = "none";
d.innerHTML = "<textarea id='Descriptions' style='width:450px; height:
250px'></textarea>";
body.appendChild(d);
d.style.display = "block";
tinyMCEOnDemand();
}

function tinyMCEOnDemand(){
var head = document.getElementsByTagName("head")[0];
var script = document.createElement('script');
script.id = 'tinyMCEScriptInitializer';
script.type = 'text/javascript';
script.src = "tinyInit.js";
head.appendChild(script);
}
</script>
<!-- /tinyMCE -->

</head>
<body onload="setTimeout('start()',3000);">
</body>
</html>

============================
tinyInit.js file has:

tinyMCE.init({
theme : "advanced",
mode : "exact",
elements : "Descriptions",
save_callback : "customSave",
content_css : "example_advanced.css",
extended_valid_elements : "a[href|target|name]",
plugins : "table",
theme_advanced_buttons3_add_before :
"tablecontrols,separator",
//invalid_elements : "a",
theme_advanced_styles : "Header 1=header1;Header
2=header2;Header 3=header3;Table Row=tableRow1", // Theme specific
setting CSS classes
//execcommand_callback : "myCustomExecCommandHandler",
debug : false
});

// Custom event handler
function myCustomExecCommandHandler(editor_id, elm, command,
user_interface, value) {
var linkElm, imageElm, inst;

switch (command) {
case "mceLink":
inst = tinyMCE.getInstanceById(editor_id);
linkElm =
tinyMCE.getParentElement(inst.selection.getFocusEl ement(), "a");

if (linkElm)
alert("Link dialog has been overriden. Found link href: " +

tinyMCE.getAttrib(linkElm, "href"));
else
alert("Link dialog has been overriden.");

return true;

case "mceImage":
inst = tinyMCE.getInstanceById(editor_id);
imageElm =
tinyMCE.getParentElement(inst.selection.getFocusEl ement(), "img");

if (imageElm)
alert("Image dialog has been overriden. Found image src: " +

tinyMCE.getAttrib(imageElm, "src"));
else
alert("Image dialog has been overriden.");

return true;
}

return false; // Pass to next handler in chain
}
// Custom save callback, gets called when the contents is to be
submitted
function customSave(id, content) {
alert(id + "=" + content);
}

Jun 5 '07 #1
8 4822
vu******@gmail.com wrote:
I have difficulties initializing TinyMCE.
<snip TinyMCE code and whatnot>

You are *still* working on that TinyMCE example?

Any link to your example? Any errors or is TinyMCE just not behaving as
you expect?

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.
Jun 5 '07 #2
On Jun 5, 4:30 pm, -Lost <maventheextrawo...@techie.comwrote:
vunet...@gmail.com wrote:
I have difficulties initializing TinyMCE.

<snip TinyMCE code and whatnot>

You are *still* working on that TinyMCE example?

Any link to your example? Any errors or is TinyMCE just not behaving as
you expect?

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.
Yes, still working, thanks.
Error: tinyMCE is not defined and page keeps loading witout any
success.
Working Example: http://www.eclayer.com/tinymceexample.html
Included File: http://www.eclayer.com//tinymce/jscr...ce/tiny_mce.js
(Note: not my website but a good demo)

Jun 5 '07 #3
THIS IS a plug-n-play example which works! Try to remove textarea and
it won't work. My goal is to add textarea dynamically and init
tinyMCE. That's all...

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>My example</title>
<!-- tinyMCE -->

<script language="javascript" type="text/javascript"

src="http://www.eclayer.com//tinymce/jscripts/tiny_mce/tiny_mce.js"></
script>

<script language="javascript" type="text/javascript">
tinyMCE.init({
theme : "advanced",
mode : "exact",
elements : "Descriptions",
save_callback : "customSave",
content_css : "example_advanced.css",
extended_valid_elements : "a[href|target|name]",
plugins : "table",
theme_advanced_buttons3_add_before :
"tablecontrols,separator",
//invalid_elements : "a",
theme_advanced_styles : "Header 1=header1;Header
2=header2;Header 3=header3;Table Row=tableRow1", // Theme

specific setting CSS classes
//execcommand_callback : "myCustomExecCommandHandler",
debug : false
});
// Custom event handler
function myCustomExecCommandHandler(editor_id, elm, command,
user_interface, value) {
var linkElm, imageElm, inst;

switch (command) {
case "mceLink":
inst = tinyMCE.getInstanceById(editor_id);
linkElm =
tinyMCE.getParentElement(inst.selection.getFocusEl ement(), "a");

if (linkElm)
alert("Link dialog has been overriden. Found link href: " +

tinyMCE.getAttrib(linkElm, "href"));
else
alert("Link dialog has been overriden.");

return true;

case "mceImage":
inst = tinyMCE.getInstanceById(editor_id);
imageElm =
tinyMCE.getParentElement(inst.selection.getFocusEl ement(), "img");

if (imageElm)
alert("Image dialog has been overriden. Found image src: " +

tinyMCE.getAttrib(imageElm, "src"));
else
alert("Image dialog has been overriden.");

return true;
}

return false; // Pass to next handler in chain
}

// Custom save callback, gets called when the contents is to be
submitted
function customSave(id, content) {
alert(id + "=" + content);
}
</script>
<!-- /tinyMCE -->

</head>
<body>

<textarea id='Descriptions' style='width:450px; height:250px'></
textarea>

</body>
</html>

Jun 5 '07 #4
vu******@gmail.com wrote:
THIS IS a plug-n-play example which works! Try to remove textarea and
it won't work. My goal is to add textarea dynamically and init
tinyMCE. That's all...
<snip semi-working example>

1. Either rewrite the init() method, because its DOM-readiness is shit.

I tried tests both by dynamically adding textareas and by attempting to
hide/show them.

No luck.

The init() method does some really weird stuff in regards to the
original textarea. For example, it rewrites the entire damn thing into
this convoluted TABLE, SPAN crap.

2. Find the TABLE of TinyMCE and hide it. Here is the kicker though...
YOU MUST hide it via JavaScript. Do it via CSS and the TABLE gets
removed before TinyMCE initializes it. Another sign of TinyMCE and/or
its init() method being feces.

I have seen stool samples with better code and practices than what
TinyMCE produces.

Poop Count = 4

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.
Jun 5 '07 #5
On Jun 5, 12:58 pm, vunet...@gmail.com wrote:
Hi all,
I have difficulties initializing TinyMCE.
Is the TinyMCE support not helpful?

http://tinymce.moxiecode.com/punbb/index.php

Peter

Jun 5 '07 #6
On Jun 5, 6:16 pm, Peter Michaux <petermich...@gmail.comwrote:
On Jun 5, 12:58 pm, vunet...@gmail.com wrote:
Hi all,
I have difficulties initializing TinyMCE.

Is the TinyMCE support not helpful?

http://tinymce.moxiecode.com/punbb/index.php

Peter
The cost per question is €25.

Jun 6 '07 #7
On Jun 5, 5:09 pm, vunet...@gmail.com wrote:
On Jun 5, 6:16 pm, Peter Michaux <petermich...@gmail.comwrote:
On Jun 5, 12:58 pm, vunet...@gmail.com wrote:
Hi all,
I have difficulties initializing TinyMCE.
Is the TinyMCE support not helpful?
http://tinymce.moxiecode.com/punbb/index.php
Peter

The cost per question is €25.
Holy crap! Do they pay €25 for each bug report?

I just loaded their demo. Wow that took a long time.

What about the FCKEditor? Free support.

Peter

Jun 6 '07 #8
On Jun 5, 7:54 pm, Peter Michaux <petermich...@gmail.comwrote:
On Jun 5, 5:09 pm, vunet...@gmail.com wrote:
On Jun 5, 6:16 pm, Peter Michaux <petermich...@gmail.comwrote:
On Jun 5, 12:58 pm, vunet...@gmail.com wrote:
Hi all,
I have difficulties initializing TinyMCE.
Is the TinyMCE support not helpful?
>http://tinymce.moxiecode.com/punbb/index.php
Peter
The cost per question is €25.

Holy crap! Do they pay €25 for each bug report?

I just loaded their demo. Wow that took a long time.

What about the FCKEditor? Free support.

Peter
I may have found what I need but I still solve various aspects such as
appending innerHTML, etc.:

http://tinymce.moxiecode.com/punbb/v...ic.php?id=4673

Jun 6 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: merrily | last post by:
Read in one forum the question someone asked after successfully (sort of) installing Picture It 2000 on new computer with Vista. Will this person or any other help me accomplish this install on...
2
by: sandeepsandeep | last post by:
Hi I searched for the full setence and I couldn't find any help so here it goes. I got the error "tinyMCE is undefined" in the status bar of MSIE when runing my site from the server. When I'm using...
7
by: tokcy | last post by:
hi everyone, i have used tinymce editor in my project, but i have some problem like whenever i am selecting data from database and when i want to wiew the details of that particular section then...
1
by: kishor123 | last post by:
Hi every body I am using a tinybrowser plugin for ploading the files in localhost. Also i am using the thick box. I am loading the tinyMce in the thick box. then while uploading the image...
5
matheussousuke
by: matheussousuke | last post by:
Hello, I'm using tiny MCE plugin on my oscommerce and it is inserting my website URL when I use insert image function in the emails. The goal is: Make it send the email with the URL...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.