12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- (function($) {
- Drupal.wysiwyg.editor.attach.jwysiwyg = function(context, params, settings) {
-
- $('#' + params.field).wysiwyg();
- };
- Drupal.wysiwyg.editor.detach.jwysiwyg = function (context, params, trigger) {
- var $field = $('#' + params.field);
- var editor = $field.data('wysiwyg');
- if (typeof editor != 'undefined') {
- editor.saveContent();
- if (trigger != 'serialize') {
- editor.element.remove();
- }
- }
- $field.removeData('wysiwyg');
- if (trigger != 'serialize') {
- $field.show();
- }
- };
- Drupal.wysiwyg.editor.instance.jwysiwyg = {
- insert: function (content) {
- $('#' + this.field).wysiwyg('insertHtml', content);
- },
- setContent: function (content) {
- $('#' + this.field).wysiwyg('setContent', content);
- },
- getContent: function () {
- return $('#' + this.field).wysiwyg('getContent');
- }
- };
- })(jQuery);
|