markitup.js 804 B

1234567891011121314151617181920212223242526272829
  1. (function($) {
  2. /**
  3. * Attach this editor to a target element.
  4. */
  5. Drupal.wysiwyg.editor.attach.markitup = function(context, params, settings) {
  6. $('#' + params.field, context).markItUp(settings);
  7. // Adjust CSS for editor buttons.
  8. $.each(settings.markupSet, function (button) {
  9. $('.' + settings.nameSpace + ' .' + this.className + ' a')
  10. .css({ backgroundImage: 'url(' + settings.root + 'sets/default/images/' + button + '.png' + ')' })
  11. .parents('li').css({ backgroundImage: 'none' });
  12. });
  13. };
  14. /**
  15. * Detach a single or all editors.
  16. */
  17. Drupal.wysiwyg.editor.detach.markitup = function(context, params) {
  18. if (typeof params != 'undefined') {
  19. $('#' + params.field, context).markItUpRemove();
  20. }
  21. else {
  22. $('.markItUpEditor', context).markItUpRemove();
  23. }
  24. };
  25. })(jQuery);