简体   繁体   English

将WordPress编辑器移植到非WP应用程序时出现问题

[英]Problem porting WordPress Editor to a non-WP application

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. 我喜欢WordPress编辑器(2.7版)的外观,并且希望在另一个用ASP.NET编写的Web应用程序中使用它。 I've used TinyMCE before, and I've even extended it in the past. 我以前使用过TinyMCE,甚至在过去也进行过扩展。 However, I can't seem to get the Wordpress configuration to work! 但是,我似乎无法让Wordpress配置正常工作!

I've downloaded the entire WordPress package and taken the TinyMCE code (from the "js" folder) and put it in my web site. 我已经下载了整个WordPress软件包,并获取了TinyMCE代码(来自“ js”文件夹),并将其放在我的网站中。 It ends up giving me an error on the following line of tiny_mce.js 最后在tiny_mce.js的以下行中给我一个错误

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

'undefined' is null or not an object. 'undefined'为null或不是对象。

Now, I've carefully made sure that the steps of execution are identical with the WordPress demonstration site that I've based this from. 现在,我已经仔细确保执行步骤与我基于WordPress的演示站点相同。

I'm not a Javascript newbie (at all), but I can't seem to figure out why this is not working. 我根本不是Javascript新手,但是我似乎无法弄清楚为什么它不起作用。 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"). 这里是我正在谈论的演示(用户名=“ admin”,密码=“ demo”)。 View the source, I have the three parts of Javascript that are (seemingly) required to power the editor. 查看源代码,我拥有(似乎)为编辑器提供动力所需的Javascript的三个部分。

我建议包括tiny_mce_src.js而不是最小版本,这样您可以使用firebug调试并接收有用的信息。

在黑暗中有些刺痛,但是我怀疑是对WP的prototype.js的依赖,而您并未将TinyMCE带来这种依赖。

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. 我尝试使用firebug查看演示,但是tinymce.js只是一行,所以我放弃了尝试查找该代码的过程。 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? 如果您有萤火虫,请尝试在控制台中放置一些console.log(),或者在该行之前放入alert()s,并尝试查看yu得到错误时的f,s,this,arguments等,然后使用相同的方法香草WP安装,看看有什么区别吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM