2017-07-30 85 views
0

私はFroalaエディタを使いたいと思います。次の設定では、ビデオの挿入ボタンを見ることができ、YouTubeのリンクや埋め込みコードを追加するための小さなウィンドウを開くことができます。ただし、リンクや埋め込みコードを入力して[挿入]ボタンをクリックすると、編集領域に何も表示されません。なにが問題ですか?Froala WYSIWYG editor:Youtubeビデオリンクや埋め込みコードを編集エリアに挿入できないのはなぜですか?

 $('textarea').froalaEditor({ 
      charCounterCount: true, 
      codeMirror: false, 
      charCounterMax: 1000, 
      direction: 'ltr', 
      disableRightClick: false, 
      editorClass: 'froala-editor', 
      htmlAllowComments: false, 
      htmlAllowedEmptyTags: [], 
      htmlExecuteScripts: false, 
      htmlRemoveTags: ['script', 'style', 'base'], 
      placeholderText: '', 
      pluginsEnabled: ['align','codeView','colors','draggable','emoticons','entities','fontFamily','fontSize','fullscreen','image','lineBreaker','link','lists','paragraphFormat','quote','video'], 
      shortcutsEnabled: ['show', 'bold', 'italic', 'underline', 'strikeThrough', 'indent', 'outdent', 'undo', 'redo', 'insertImage', 'createLink'], 
      spellcheck: false, 
      toolbarButtons: ['fullscreen', 'bold', 'italic', 'underline', '|', 'fontFamily', 'fontSize', 'color', 'inlineStyle', 'paragraphStyle', '|', 'paragraphFormat', 'align', 'formatOL', 'formatUL', 'outdent', 'indent', 'quote', '|', 'insertLink', 'insertImage', 'insertVideo', '|', 'emoticons', 'specialCharacters', 'insertHR', 'selectAll', 'clearFormatting', '|', 'print', 'help', 'html', '|', 'undo', 'redo'], 
      toolbarButtonsSM: null, 
      toolbarButtonsXS: null, 
      toolbarSticky: false, 
      toolbarVisibleWithoutSelection: true, 
      imageAllowedTypes: ['jpeg', 'jpg', 'png','gif'], 
      imageEditButtons: ['imageReplace', 'imageAlign', 'imageRemove', '|', 'imageLink', 'linkOpen', 'linkEdit', 'linkRemove', '-', 'imageDisplay', 'imageAlt', 'imageSize'], 
      imageMaxSize: 1024 * 1024 * 1, 
      linkInsertButtons: ['linkBack'], 
      paragraphFormat: { 
       N: 'Normal', 
       H1: 'Heading 1', 
       H2: 'Heading 2', 
       H3: 'Heading 3', 
      }, 
      videoAllowedProviders: ['youtube', 'vimeo'], 
      videoInsertButtons: ['videoBack', '|', 'videoByURL', 'videoEmbed'] 
     }) 
    }); 
+0

挿入しようとしているURLは何ですか? – st3fan

+0

これは単なる例です。私はそれを開き、URLをブラウザのアドレスバーからコピーします:https://www.youtube.com/watch?v=yoPq-s7-_qM&t=152s – curious1

+0

ステファン、この質問を見ていただけますか?ありがとう! https://stackoverflow.com/questions/45396636/froala-wysiwyg-editor-how-to-do-background-color – curious1

答えて

0

私は答えを見つけました。の場合

htmlAllowedEmptyTags 

は空であってはいけません。最初はscriptを除外したいと思いますが、あまりにも遠すぎました。今度は、ビデオリンクを挿入することができます。

htmlAllowedEmptyTags: ['textarea', 'a', 'iframe', 'object', 'video', 'style','.fa'] 

これは、ここに来た他の人に役立ちます。

関連する問題