# HG changeset patch # User Franck Deroche # Date 1244113195 -7200 # Node ID 272628486e7537298682fd8e805ee14ecacf33f2 # Parent 5328b450f7b76df3a5ad01bc8f78c3006ee4a352 Adding the MEE Ressource Manager ! diff -r 5328b450f7b7 -r 272628486e75 css/mee.css --- a/css/mee.css Wed Jun 03 15:02:37 2009 +0200 +++ b/css/mee.css Thu Jun 04 12:59:55 2009 +0200 @@ -2,10 +2,15 @@ float: left; width: 100%; } -.mee-wrap-editor-library .form-item { - float: left; +.mee-wrap-editor-library .form-item, table.mee-ressource-manager, .mee-filter-form { width: 73%; } +.mee-filter-form .form-item { + width: 100%; +} +.mee-filter-form .form-item .tips li { + white-space: normal; +} #scald-dnd-library-form .form-item { float: none; width: auto; @@ -21,9 +26,6 @@ float: right; width: 25%; } -.mee-filter-form { - clear: left; -} .dnd-library-wrapper .header { padding: 3px 4px; background-color: #ccc; @@ -37,7 +39,7 @@ .dnd-library-wrapper .view-filters textarea { font-size: .875em; } -.dnd-library-wrapper .header h3 { +.dnd-library-wrapper .header h3, .mee-ressource-manager h3 { font-size: 12px; font-weight: bold; } diff -r 5328b450f7b7 -r 272628486e75 mee.js --- a/mee.js Wed Jun 03 15:02:37 2009 +0200 +++ b/mee.js Thu Jun 04 12:59:55 2009 +0200 @@ -1,2 +1,55 @@ Drupal.behaviors.mee = function(context) { + $("div.mee-wrap-editor-library:not(.mee-processed)") + .addClass('mee-processed') + .find('> div.dnd-library-wrapper') + .each(function() { + var $editor = $('#' + this.id.slice(0, -12)); + $editor.bind('wysiwygAttach', Drupal.mee.attach); + $editor.bind('wysiwygDetach', Drupal.mee.detach); + }) + .end() } + +Drupal.mee = { + attach: function(e, data) { + var t = setInterval(function() { + var tiny_instance = tinyMCE.getInstanceById(data.field); + if (tiny_instance) { + clearInterval(t); + $(tiny_instance.editor_id) + .find('iframe') + .unbind('dnd_drop') + .bind('dnd_drop', function(e, data) { + var rep = Drupal.settings.dndEditorRepresentations[data.representation_id]; + $(this) + .parents('div.mee-wrap-editor-library.mee-processed') + .find('table.mee-ressource-manager') + .each(function(i) { + $(this).append(Drupal.mee.generate( + rep.title, + Drupal.tableDrag[this.id] + )); + }); + }); + } + }, 100); + }, + detach: function(e, data) { + + }, + generate: function(title, tableDrag) { + var $select = $("