Index: asset.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/asset/asset.module,v retrieving revision 1.1.2.37 diff -u -p -r1.1.2.37 asset.module --- asset.module 28 Oct 2008 11:16:04 -0000 1.1.2.37 +++ asset.module 25 Mar 2009 21:26:05 -0000 @@ -568,6 +568,7 @@ function asset_wizard() { require_once(drupal_get_path('module', 'asset') .'/asset_wizard.inc'); drupal_add_js(array('asset' => array('basePath' => base_path())), 'setting'); drupal_add_js(drupal_get_path('module', 'asset') .'/asset.js'); + drupal_add_js(drupal_get_path('module', 'asset') .'/asset_more.js'); drupal_add_css(drupal_get_path('module', 'asset') .'/asset_wizard.css'); list($sites, $site, $lost) = split("/", drupal_get_path('module', 'asset'), 3); $theme = variable_get('asset_wizard_theme', drupal_get_path('module', 'asset') .'/themes/default/asset_wizard.css'); @@ -583,6 +584,10 @@ function asset_wizard() { drupal_add_js(drupal_get_path('module', 'tinymce') .'/tinymce/jscripts/tiny_mce/tiny_mce_popup.js'); drupal_add_js(drupal_get_path('module', 'asset') .'/tinymce/asset_tinymce.js'); break; + case 'wysiwyg' : + drupal_add_js(drupal_get_path('module', 'tinymce') .'/tinymce/jscripts/tiny_mce/tiny_mce_popup.js'); + drupal_add_js(drupal_get_path('module', 'asset') .'/plugins/drupalasset/drupalasset.js'); + break; } $output = drupal_get_form('asset_wizard_form'); ob_end_clean(); @@ -1099,3 +1104,13 @@ function theme_asset_textarea_link($elem $output .='
'. $link .'
'; return $output; } + +/** + * Implementation of hook_wysiwyg_include_directory(). + */ +function asset_wysiwyg_include_directory($type) { + switch ($type) { + case 'plugins': + return $type; + } +} \ No newline at end of file Index: asset_more.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/asset/asset_more.js,v retrieving revision 1.1.2.2 diff -u -p -r1.1.2.2 asset_more.js --- asset_more.js 19 Dec 2007 18:50:23 -0000 1.1.2.2 +++ asset_more.js 25 Mar 2009 21:26:05 -0000 @@ -72,3 +72,47 @@ Drupal.jslink.prototype.onerror = functi if (Drupal.jsEnabled) { $(document).ready(Drupal.linkAutoAttach); } + +function _assetInlineToTag(content) { + content = content.replace(/\[asset\|([^\[\]]+)\]/g, function(orig, match) { + var asset = {}, chunks = match.split('|'); + for (var i in chunks) { + chunks[i].replace(/([^=]+)=(.*)/g, function(o, property, value) { + asset[property] = value; + }); + } + asset.name = 'mceItemDrupalAsset'; + asset.class = 'mceItemDrupalAsset'; + asset.src = _assetPreviewSrc(asset); + asset.alt = 'aid=' + asset.aid + '|title=' + asset.title + '|desc=' + asset.desc; + if (asset.link && asset.link.indexOf(',') != -1) { + var link = asset.link.split(',', 2); + asset.alt += '|link=' + link[0] + '|url=' + link[1]; + } + else { + asset.alt += '|link=' + asset.link; + } + if (typeof asset.url != 'undefined') { + asset.alt += '|url=' + asset.url; + } + asset.alt = encodeURIComponent(asset.alt); + var element = ' 'button', '#value' => t('Select'),