plugin.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /**
  2. * Plugin created by BeezNest Latino S.A.C
  3. *
  4. * For licensing terms, see /license.txt
  5. *
  6. * This plugin allows set quizzes markers in video with mediaelement.
  7. */
  8. (function () {
  9. CKEDITOR.plugins.add('qmarkersrolls', {
  10. lang: [
  11. 'en',
  12. 'es',
  13. ],
  14. requires: ['video'],
  15. init: function (editor) {
  16. var lang = editor.lang.qmarkersrolls;
  17. editor
  18. .addCommand(
  19. 'qmarkersrolls',
  20. new CKEDITOR.dialogCommand('qMarkersrollsDialog')
  21. );
  22. if (editor.contextMenu) {
  23. editor.addMenuGroup('qMarkersRollsGroup');
  24. editor.addMenuItem('qMarkersRollsItem', {
  25. label: lang.setQuizMarkersRolls,
  26. icon: this.path + 'images/icon.png',
  27. command: 'qmarkersrolls',
  28. group: 'qMarkersRollsGroup'
  29. });
  30. editor.contextMenu.addListener(function (element) {
  31. if (element &&
  32. element.is('img') &&
  33. !element.isReadOnly() &&
  34. element.data('cke-real-element-type') == 'video'
  35. ) {
  36. return {
  37. qMarkersRollsItem: CKEDITOR.TRISTATE_OFF
  38. };
  39. }
  40. });
  41. }
  42. CKEDITOR.dialog.add('qMarkersrollsDialog', this.path + 'dialogs/qmarkersrolls.js');
  43. }
  44. });
  45. })();