-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create PublicLab.RichTextModule.Embeds.js (#108)
* Create PublicLab.RichTextModule.Embeds.js * Update PublicLab.Woofmark.js * Update PublicLab.RichTextModule.Embeds.js * new button for YouTube embeds * fixes
- Loading branch information
Showing
4 changed files
with
51 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
Embed insertion: <iframe width="560" height="315" src="https://www.youtube.com/embed/Ej_l1hANqMc" frameborder="0" allowfullscreen></iframe> | ||
*/ | ||
|
||
module.exports = function initEmbed(_module, wysiwyg) { | ||
|
||
// create a menu option for embeds: | ||
$('.wk-commands').append('<a class="woofmark-command-embed btn btn-default"><i class="fa fa-youtube"></i></a>'); | ||
|
||
$('.wk-commands .woofmark-command-embed').click(function() { | ||
wysiwyg.runCommand(function(chunks, mode) { | ||
chunks.before += _module.wysiwyg.parseMarkdown("\n\n\n" + prompt("Enter the full embed code offered by the originating site; for YouTube, that might be: <iframe width='100%' src='https://youtube.com/embed/_________' frameborder='0' allowfullscreen></iframe>") + "\n"); // newlines before and after | ||
_module.afterParse(); // tell editor we're done here | ||
}); | ||
|
||
}); | ||
|
||
} |