2010-12-03 16 views
2

こんにちは私はユーチューブの動画を挿入するには、次のCKEditorバージョンのプラグインを作成しました:CKEditorバージョンのプラグイン - OKボタン権限エラー

(function() { 
    CKEDITOR.plugins.add('youtube', { 
     requires : ['iframedialog'], 
     init : function(editor) { 
      var iframeWindow = null; 
      CKEDITOR.dialog.add('youtube_dialog', function() { 
       return { 
        title : 'YouTube Movie Properties', 
        minWidth : 550, 
        minHeight : 200, 
        contents : [{ 
         id : 'iframe', 
         label : 'Insert YouTube Movie', 
         expand : true, 
         elements : [{ 
          type : 'iframe', 
          src : me.path + 'dialogs/youtube.html', 
          width : '100%', 
          height : '100%', 
          onContentLoad : function() { 
           iframeWindow = document.getElementById(this._.frameId).contentWindow; 
          } 
         }] 
        }], 
        onOk : function() { 
         this._.editor.insertHtml('<cke:youtube url="' + iframeWindow.document.getElementById('url').value + '">YouTube Video Place Marker</cke:youtube>'); 
        } 
       }; 
      }); 
      editor.addCommand('youtube', new CKEDITOR.dialogCommand('youtube_dialog')); 
      editor.ui.addButton('YouTube', { 
       label : 'Insert YouTube Movie', 
       command : 'youtube', 
       icon : this.path + 'images/icon.gif' 
      }); 
     } 
    }); 
})(); 

これは罰金働いていたが、私は最近、CDNに私のCKEditorバージョンのファイルを移動しました。今すぐ "OK"ボタンをクリックすると、パーミッションエラーが発生します。私は既存のプラグインのソースを見て、どのように動作するのかを知っていましたが、試したものは動作していないようです。何か基本的な作業をするために私はokOkイベントを変更しようとしました:

onOk : function() { 
    var hr = new CKEDITOR.dom.element('hr', editor.document); 
    editor.insertElement(hr); 
} 

しかし、これは私にnull参照例外を与えました。

私が間違っていることを誰かが私に見せることができたら、本当に感謝しています。ありがとう

答えて

1

問題が解決しました!

CKEDITOR.dialog.add('youtube_dialog', function() 

へ:

CKEDITOR.dialog.add('youtube_dialog', function(editor) 

と変更:ソリューションは、変更することです

this._.editor 

に:

editor 

・ホープ、このことができます。

関連する問題