Mercurial > defr > drupal > scald > dnd
comparison dnd.module @ 18:0d557e6e73f7
Added beautytips and some additional event handling code to the library.
| author | David Eads <eads@chicagotech.org> |
|---|---|
| date | Fri, 06 Mar 2009 14:11:46 -0600 |
| parents | 1a77f87927dd |
| children | d83073a08b25 |
comparison
equal
deleted
inserted
replaced
| 17:1a77f87927dd | 18:0d557e6e73f7 |
|---|---|
| 74 * configuration options | 74 * configuration options |
| 75 * callback should be smart about attachment and detachment | 75 * callback should be smart about attachment and detachment |
| 76 */ | 76 */ |
| 77 function dnd_process_textarea($element, $form_state) { | 77 function dnd_process_textarea($element, $form_state) { |
| 78 if ($element['#dnd-enabled']) { | 78 if ($element['#dnd-enabled']) { |
| 79 | 79 drupal_add_js(drupal_get_path('module', 'dnd') .'/js/bt/other_libs/excanvas-compressed.js'); |
| 80 drupal_add_js(drupal_get_path('module', 'dnd') .'/js/jquery.url.packed.js', 'footer'); | 80 drupal_add_js(drupal_get_path('module', 'dnd') .'/js/jquery.url.packed.js'); |
| 81 drupal_add_js(drupal_get_path('module', 'dnd') .'/js/jquery.fieldselection.js', 'footer'); | 81 drupal_add_js(drupal_get_path('module', 'dnd') .'/js/jquery.fieldselection.js'); |
| 82 drupal_add_js(drupal_get_path('module', 'dnd') .'/js/dnd.js', 'footer'); | 82 drupal_add_js(drupal_get_path('module', 'dnd') .'/js/bt/jquery.bt.js'); |
| 83 drupal_add_js(drupal_get_path('module', 'dnd') .'/js/dnd-library.js', 'footer'); | 83 drupal_add_js(drupal_get_path('module', 'dnd') .'/js/jquery.draganddrop.js'); |
| 84 drupal_add_js(drupal_get_path('module', 'dnd') .'/js/dnd-library.js'); | |
| 84 | 85 |
| 85 $settings = array(); | 86 $settings = array(); |
| 86 | 87 |
| 87 // We take a string or an | 88 // We take a string or an object or an array |
| 88 if (is_string($element['#dnd-settings'])) { | 89 if (is_string($element['#dnd-settings'])) { |
| 89 // @TODO load settings | 90 // @TODO load settings |
| 90 } | 91 } |
| 91 else if (is_object($element['#dnd-settings'])) { | 92 else if (is_object($element['#dnd-settings'])) { |
| 92 $settings = (array) $element['#dnd-settings']; | 93 $settings = (array) $element['#dnd-settings']; |
| 106 $element['#prefix'] = theme('dnd_library', $element, $settings); | 107 $element['#prefix'] = theme('dnd_library', $element, $settings); |
| 107 } | 108 } |
| 108 return $element; | 109 return $element; |
| 109 } | 110 } |
| 110 | 111 |
| 112 /** | |
| 113 * Drag and drop library template preprocessor. | |
| 114 */ | |
| 111 function template_preprocess_dnd_library(&$variables) { | 115 function template_preprocess_dnd_library(&$variables) { |
| 112 global $base_url; | 116 global $base_url; |
| 113 list($element, $settings) = array($variables['element'], $variables['settings']); | 117 list($element, $settings) = array($variables['element'], $variables['settings']); |
| 114 | 118 |
| 115 // Get library via a backdoor HTTP request. This is plenty fast for this | 119 // Get library via a backdoor HTTP request. This is plenty fast for this |
