# HG changeset patch # User David Eads # Date 1236370306 21600 # Node ID 0d557e6e73f7188fc02a58822846f156a8a340e0 # Parent 1a77f87927dd2875facbda41869e86e6eac7b5bd Added beautytips and some additional event handling code to the library. diff -r 1a77f87927dd -r 0d557e6e73f7 dnd.module --- a/dnd.module Wed Mar 04 13:29:31 2009 -0600 +++ b/dnd.module Fri Mar 06 14:11:46 2009 -0600 @@ -76,15 +76,16 @@ */ function dnd_process_textarea($element, $form_state) { if ($element['#dnd-enabled']) { - - drupal_add_js(drupal_get_path('module', 'dnd') .'/js/jquery.url.packed.js', 'footer'); - drupal_add_js(drupal_get_path('module', 'dnd') .'/js/jquery.fieldselection.js', 'footer'); - drupal_add_js(drupal_get_path('module', 'dnd') .'/js/dnd.js', 'footer'); - drupal_add_js(drupal_get_path('module', 'dnd') .'/js/dnd-library.js', 'footer'); + drupal_add_js(drupal_get_path('module', 'dnd') .'/js/bt/other_libs/excanvas-compressed.js'); + drupal_add_js(drupal_get_path('module', 'dnd') .'/js/jquery.url.packed.js'); + drupal_add_js(drupal_get_path('module', 'dnd') .'/js/jquery.fieldselection.js'); + drupal_add_js(drupal_get_path('module', 'dnd') .'/js/bt/jquery.bt.js'); + drupal_add_js(drupal_get_path('module', 'dnd') .'/js/jquery.draganddrop.js'); + drupal_add_js(drupal_get_path('module', 'dnd') .'/js/dnd-library.js'); $settings = array(); - // We take a string or an + // We take a string or an object or an array if (is_string($element['#dnd-settings'])) { // @TODO load settings } @@ -108,6 +109,9 @@ return $element; } +/** + * Drag and drop library template preprocessor. + */ function template_preprocess_dnd_library(&$variables) { global $base_url; list($element, $settings) = array($variables['element'], $variables['settings']); diff -r 1a77f87927dd -r 0d557e6e73f7 dnd_test/dnd_test.module --- a/dnd_test/dnd_test.module Wed Mar 04 13:29:31 2009 -0600 +++ b/dnd_test/dnd_test.module Fri Mar 06 14:11:46 2009 -0600 @@ -114,7 +114,7 @@ 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.'; } diff -r 1a77f87927dd -r 0d557e6e73f7 js/bt/.DS_Store Binary file js/bt/.DS_Store has changed diff -r 1a77f87927dd -r 0d557e6e73f7 js/bt/.jquery.bt.js.swp Binary file js/bt/.jquery.bt.js.swp has changed diff -r 1a77f87927dd -r 0d557e6e73f7 js/bt/CHANGELOG.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/bt/CHANGELOG.txt Fri Mar 06 14:11:46 2009 -0600 @@ -0,0 +1,20 @@ +== 0.9.1 == + +* Added dynamic Ajax paths (and demo) + +== 0.9 == +* AJAX!!! +* changed jQuery.fn.bt.defaults to jQuery.bt.defaults +* Changed "titleSelector" option to "contentSelector" for clarity +* bgiframe plugin support (to fix z-index problems in IE6) +* hoverIntent plugin support! +* Added activeClass (default: "bt-active") on target elements +* Added DEMO documentation +* Added click-anywhere-to-close functionality +* Added close-when-others-open functionality +* created a changelog file :-) +* lots of various bugs fixed + + +== 0.7 (10/20/2008) == +* initial release diff -r 1a77f87927dd -r 0d557e6e73f7 js/bt/DEMO/.DS_Store Binary file js/bt/DEMO/.DS_Store has changed diff -r 1a77f87927dd -r 0d557e6e73f7 js/bt/DEMO/demofiles/beautytips.png Binary file js/bt/DEMO/demofiles/beautytips.png has changed diff -r 1a77f87927dd -r 0d557e6e73f7 js/bt/DEMO/demofiles/close.gif Binary file js/bt/DEMO/demofiles/close.gif has changed diff -r 1a77f87927dd -r 0d557e6e73f7 js/bt/DEMO/demofiles/demo-ajax.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/bt/DEMO/demofiles/demo-ajax.html Fri Mar 06 14:11:46 2009 -0600 @@ -0,0 +1,9 @@ + + +The Ajax Demo Content + + +

This paragraph should be ignored

+
This content came from a separate html page.
+ + \ No newline at end of file diff -r 1a77f87927dd -r 0d557e6e73f7 js/bt/DEMO/demofiles/demo-ie-fix.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/bt/DEMO/demofiles/demo-ie-fix.css Fri Mar 06 14:11:46 2009 -0600 @@ -0,0 +1,9 @@ +/** + * IE is completely stupid about relative elements and stacking elements + * http://therealcrisp.xs4all.nl/meuk/IE-zindexbug.html + * This fix is specific to this demo page and won't be needed for most + * uses of BeautyTips + */ +div.example { + position: static; +} \ No newline at end of file diff -r 1a77f87927dd -r 0d557e6e73f7 js/bt/DEMO/demofiles/demo.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/bt/DEMO/demofiles/demo.css Fri Mar 06 14:11:46 2009 -0600 @@ -0,0 +1,111 @@ +@charset "UTF-8"; + +body { + background: #FFF; + font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; +} + +td { + text-align: center; +} + +div.example { + margin-bottom: 20px; + position: relative; +} + +div.ie-fix { + overflow: visible; + height: 0; +} + +.target { + width: 80px; + text-align: center; + border: 2px solid #666666; + padding: 5px; + background-color: #00FFFF; + height: 45px; + display: block; + float: left; +} + +input.alt-target { + width: 80px; +} + +#page { + width: 600px; + margin-right: auto; + margin-left: auto; + background-color: #EEE; + padding: 2em; + margin-top: 0px; + margin-bottom: 0px; +} + +h3 { + color: #666666; + border-bottom-width: 2px; + border-bottom-style: solid; + border-bottom-color: #666666; + font-size: 1.2em; + margin: 0 0 .4em 0; +} +p { + margin-top: 0px; + margin-bottom: 1em; +} + +.desc { + margin-left: 100px; +} + +.source { + /*clear: both;*/ +} + +.html-source, .js, .css-source { + font-family: "Courier New", Courier, monospace; + background-color: #FFF; + /*clear: both;*/ +} + +.html-source textarea, .js textarea, .css-source textarea { + font-family: "Courier New", Courier, monospace; + font-size: 11px; +} + +.html-link a:focus, .js-link a:focus, .css-link a:focus { + outline: none; + -moz-outline: none; +} + +/** Google maps demo **/ + +#example17 { + cursor: pointer; +} + +.gmap { + font-family: Arial, sans-serif; + font-size: 13px; + position: relative; +} + +.gmap-title { + font-size: 16px; + font-weight: bold; +} + +.gmap-addr { + padding-bottom: 15px; + padding-top: 5px; +} + +.gmap-close { + position: absolute; + top: 0; + right: 0; + border: none; +} \ No newline at end of file diff -r 1a77f87927dd -r 0d557e6e73f7 js/bt/DEMO/demofiles/demo.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/bt/DEMO/demofiles/demo.js Fri Mar 06 14:11:46 2009 -0600 @@ -0,0 +1,92 @@ +/** + * Fancy script sets up the page and runs the code in the div.js elements + */ +$(function(){ + $('div.example').each(function() { + var target = $('.target, .alt-target', this); + var htmlSource = $('
').append(target.clone()).html(); + htmlSource = $('
' + escapeHTMLEncode(htmlSource) + '
'); + var html = $('').click(function(){ + if ($.browser.msie) { + // ugh!!! effing IE + $(this).parent().find('.html-source').toggle(); + } + else { + $(this).parent().find('.html-source').slideToggle(); + } + return false; + }); + var jsLink = $('').click(function(){ + if ($.browser.msie) { + $(this).parent().find('.js').toggle(); + } + else { + $(this).parent().find('.js').slideToggle(); + } + return false; + }); + + var cssSource = $('style', this); + if (cssSource.length) { + cssSource = $('
' + cssSource.html() + '
'); + var css = $('').click(function(){ + if ($.browser.msie) { + $(this).parent().find('.css-source').toggle(); + } + else { + $(this).parent().find('.css-source').slideToggle(); + } + return false; + }); + } + + var jsSource = $('.js', this); + $(jsSource).before(html); + $(jsSource).before(htmlSource); + textareaWrap(htmlSource); + $('textarea', htmlSource).data('target', target[0]).change(function(){ + var newTarg = $($(this).val()).get(0); + $($(this).data('target')).replaceWith(newTarg); + $(this).data('target', newTarg); + }); + htmlSource.hide(); + + if (typeof css != 'undefined') { + $(jsSource).before(css); + $(jsSource).before(cssSource); + textareaWrap(cssSource); + cssSource.hide(); + } + + $(jsSource).before(jsLink); + //eval the source! + eval(jsSource.html()); + textareaWrap(jsSource, true); + $('textarea', jsSource).change(function(){ + eval($(this).val()); + }); + jsSource.hide(); + }); + + // add BeautyTip to js and html-source textareas + $('div.js textarea, div.html-source textarea').bt('This is live code. Feel free to edit and try out new options. Click (or tab) out of the textarea to see the results of your edits. If things go awry, reload the page.', {positions: 'right', trigger: ['focus', 'blur'], overlap: 8, width: 150, cssStyles: {fontSize: '11px'}}); +}); + +function textareaWrap(obj, escape) { + var html = $(obj).html(); + if (escape) { + html = escapeHTMLEncode(html); + } + $(obj).empty().append($('