# HG changeset patch # User David Eads # Date 1236710809 18000 # Node ID 69db20fdbac21b6c859710548cdd01443e3fd400 # Parent 89fe0aca43d4ebad1e21d214c10e3761807d76f0 Cleanup and refactoring. diff -r 89fe0aca43d4 -r 69db20fdbac2 dnd.module --- a/dnd.module Sun Mar 08 20:29:57 2009 -0500 +++ b/dnd.module Tue Mar 10 13:46:49 2009 -0500 @@ -56,8 +56,7 @@ /** * Settings array: - * What should it take, if anything? Probably a source... - * maybe editor specific configuration shit? + * What should it take, if anything? Probably a source * maybe editor specific configuration shit? * * - source for library json/ajax shit * - target selector @@ -74,7 +73,7 @@ * configuration options * callback should be smart about attachment and detachment */ -function dnd_process_textarea($element, $form_state) { +function dnd_process_textarea($element, $edit, $form_state, $form) { if ($element['#dnd-enabled']) { // BeautyTips @@ -112,7 +111,7 @@ 'dndEnabledLibraries' => array($element['#id'] => $settings), ), 'setting'); - $element['#prefix'] = theme('dnd_library', $element, $settings); + $element['#suffix'] = theme('dnd_library', $element, $settings) . $element['#suffix']; } return $element; } diff -r 89fe0aca43d4 -r 69db20fdbac2 dnd_test/dnd-library-header.tpl.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dnd_test/dnd-library-header.tpl.php Tue Mar 10 13:46:49 2009 -0500 @@ -0,0 +1,9 @@ +

$page)); ?>

+ +
+
+
+
+
+
+ diff -r 89fe0aca43d4 -r 69db20fdbac2 dnd_test/dnd-library-preview.tpl.php --- a/dnd_test/dnd-library-preview.tpl.php Sun Mar 08 20:29:57 2009 -0500 +++ b/dnd_test/dnd-library-preview.tpl.php Tue Mar 10 13:46:49 2009 -0500 @@ -1,17 +1,20 @@ -
+

-
+ +
+
+ +
+
+ | + +
+
+ +
-
- -
- -
-
-
-
diff -r 89fe0aca43d4 -r 69db20fdbac2 dnd_test/dnd_test.css --- a/dnd_test/dnd_test.css Sun Mar 08 20:29:57 2009 -0500 +++ b/dnd_test/dnd_test.css Tue Mar 10 13:46:49 2009 -0500 @@ -132,3 +132,23 @@ .dnd-library-wrapper .editor-item.dnd-child-inserted { background-color: #ccc; } +.dnd-editor-preview h2.title { + font-size: 1em; + font-weight: bold; + margin-bottom: 0.5em; +} +.dnd-editor-preview .media-preview { + float: left; + width: 125px; +} + +.dnd-editor-preview .media-meta { + float: left; + width: 225px; + margin-right: 20px; +} + +.dnd-editor-preview .attribution { + font-size: .875em; + margin-bottom: .5em; +} diff -r 89fe0aca43d4 -r 69db20fdbac2 dnd_test/dnd_test.module --- a/dnd_test/dnd_test.module Sun Mar 08 20:29:57 2009 -0500 +++ b/dnd_test/dnd_test.module Tue Mar 10 13:46:49 2009 -0500 @@ -118,9 +118,9 @@ template_preprocess_dnd_library_item($variables); $variables['id'] = 'dnd-preview-'. $variables['i']; - $variables['image'] = ''; + $variables['image'] = ''; - $variables['description'] = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.'; + $variables['description'] = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.'; } diff -r 89fe0aca43d4 -r 69db20fdbac2 js/bt/.jquery.bt.js.swp Binary file js/bt/.jquery.bt.js.swp has changed diff -r 89fe0aca43d4 -r 69db20fdbac2 js/dnd-library.js --- a/js/dnd-library.js Sun Mar 08 20:29:57 2009 -0500 +++ b/js/dnd-library.js Tue Mar 10 13:46:49 2009 -0500 @@ -40,7 +40,7 @@ $('.editor-item', context).each(function () { $(this).bt(Drupal.settings.dndLibraryPreviews[this.id], { 'trigger': 'none', - 'width': 300, + 'width': 375, 'spikeLength': 7, 'spikeGirth': 9, 'corner-radius' : 3, @@ -75,13 +75,13 @@ return false; }); - $('.view-filters form', $this).submit(function() { + $('.view-filters input[type=submit]', $this).click(function() { $(this).ajaxSubmit({ - // @TODO add URL from settings and target more specifically... + 'url' : Drupal.settings.basePath + Drupal.settings.dndEnabledLibraries[$editor.get(0).id].url, 'dataType': 'json', 'success': function(responsetext, statustext) { - drupal.behaviors.dndlibrary.responsetext.call($this.get(0), responsetext, $editor); - drupal.behaviors.dndlibrary(); + Drupal.behaviors.dndLibrary.refreshLibrary.call($this.get(0), responsetext, $editor); + Drupal.behaviors.dndLibrary(); } }); return false;