1

I have a button in my web page that trigger this function to to insert a video, here is the code:

function setVideo(encodeUrl) {
    var url = decodeURIComponent(encodeUrl);
    var htmlstr = "<div id='video_segment'><object  id='obx' name='obx'   width='290' height='260'>";
    htmlstr += "<param name='movie' value='" + url + "'></param>";
    htmlstr += "<param name='allowFullScreen' value='true'></param>";
    htmlstr += "<param name='allowscriptaccess' value='always'></param>";
    htmlstr += "<param name='wmode' value='opaque'></param>";
    htmlstr += "<embed src='" + url + "' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' wmode='opaque' width='290' height='260'></embed>";
    htmlstr += "</object></div>";
    alert(htmlstr);
    CKEDITOR.instances.Content.insertHtml(htmlstr);
 }

But,it can not insert the object tag into my CKEditor.By the way, I can insert an image by this way. Why ?


What you might be looking for is the rs.setRawMode(mode) for the native TTY modules. Originally in Node v0.8.x, there was a undocumented keypress event for process.stdin that would emit when it was a TTY. It was then altered to only fire when being used with readline, so I would suggest using that.

The functionality is still accessible by a module called keypress. It was directly taken from Node source, and is used like so (taken from documentation):

var keypress = require('keypress');

// make `process.stdin` begin emitting "keypress" events
keypress(process.stdin);

// listen for the "keypress" event
process.stdin.on('keypress', function (ch, key) {
  console.log('got "keypress"', key);
  if (key && key.ctrl && key.name == 'c') {
    process.stdin.pause();
  }
});

process.stdin.setRawMode(true);
process.stdin.resume();

It's also been altered to support a mousepress event that you will also find on the GitHub page.

4

1 に答える 1

3

まず、その HTML の大部分を削除する可能性が高い高度なコンテンツ フィルターを構成する必要があります。たとえば、次のように既存の設定を拡張できます。

config.extraAllowedContent = 'div[id]; object[id,name,width,height]; param[name,value]; ' +
    'embed[src,type,allowscriptaccess,allowfullscreen,wmode,width,height]';

標準のCKEditor パッケージ (持っていると思います) には含まれていない公式のフラッシュ プラグインがあることに注意してくださいobjectembedparam

extraAllowedContentしたがって、そのプラグインをパッケージに含める場合は、上で定義したもののほとんどを省略できます。

于 2013-09-03T06:10:27.033 に答える