views:

127

answers:

2

I like the look and feel of the WordPress editor (version 2.7), and I would like to use it in another web application that is written in ASP.NET. I've used TinyMCE before, and I've even extended it in the past. However, I can't seem to get the Wordpress configuration to work!

I've downloaded the entire WordPress package and taken the TinyMCE code (from the "js" folder) and put it in my web site. It ends up giving me an error on the following line of tiny_mce.js

return f.apply(s||this,Array.prototype.slice.call(arguments,2))

'undefined' is null or not an object.

Now, I've carefully made sure that the steps of execution are identical with the WordPress demonstration site that I've based this from.

I'm not a Javascript newbie (at all), but I can't seem to figure out why this is not working. Has anybody tried to do this before? What am I missing?

A demo of what I am talking about is here (username "admin", password "demo"). View the source, I have the three parts of javascript that are (seemingly) required to power the editor.

Thank you!

A: 

Something of a stab in the dark, but I'm suspecting that there's a dependency on WP's prototype.js and you didn't bring that over with TinyMCE.

chaos
I don't think so. The error occurs within TinyMCE. View the source of this: http://demo.opensourcecms.com/wordpress/wp-admin/post-new.php username admin password demo
Josh Stodola
A: 

If you are able to determine which bit is undefined that might give you a clue. I tried looking at the demo with firebug, but tinymce.js was all one line, so I gave up trying to find that code. Try putting in either some console.log() if you have firebug, or alert()s before that line, and try to see what f,s,this,arguments etc are when yu get the error, then do the same thing with a vanilla WP install and see the difference?

Andrew
Exactly, it's one line of code. So debugging is out of the question. But the error does not occur in the demo!!
Josh Stodola
Yeah, I guess I am just saying that it isn't clear which value is undefined. So I was suggesting putting something in the code to trace it out. Then you might be able to backtrack up and see what's missing.
Andrew