? web_widgets-embed-id-717048-4.patch
? web_widgets-embed-id-717048-5.patch
Index: web_widgets.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/web_widgets/web_widgets.module,v
retrieving revision 1.1.2.4
diff -u -p -r1.1.2.4 web_widgets.module
--- web_widgets.module	21 Feb 2010 15:10:24 -0000	1.1.2.4
+++ web_widgets.module	15 Jun 2010 20:05:28 -0000
@@ -71,12 +71,14 @@ function web_widgets_get_styles() {
  *   Width of the widget (not respected by all styles).
  * @param $height
  *   Height of the widget (not respected by all styles).
+ * @param $wid
+ *   ID for the widget.  Used by CSS and javascript. 
  * @return
  *   HTML that displays the widget embed code.
  */
-function web_widgets_render_embed_code($style, $path, $width, $height) {
+function web_widgets_render_embed_code($style, $path, $width, $height, $wid) {
   require_once web_widgets_get_style_inc($style);
-  $code = theme('web_widgets_'. $style, $path, $width, $height);
+  $code = theme('web_widgets_'. $style, $path, $width, $height, $wid);
   return theme('web_widgets_embed_code', $code, $style);
 }
 
Index: google_gadgets/web_widgets_style_google_gadgets.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/web_widgets/google_gadgets/web_widgets_style_google_gadgets.inc,v
retrieving revision 1.1
diff -u -p -r1.1 web_widgets_style_google_gadgets.inc
--- google_gadgets/web_widgets_style_google_gadgets.inc	24 Jun 2009 07:38:58 -0000	1.1
+++ google_gadgets/web_widgets_style_google_gadgets.inc	15 Jun 2010 20:05:28 -0000
@@ -14,7 +14,7 @@ function web_widgets_style_google_gadget
       // The HTML-Javascript code lines what should be pasted into the external site
       'web_widgets_google_gadgets' => array(
         'template' => 'web_widgets_google_gadgets',
-        'arguments' => array('path' => NULL, 'width' => NULL, 'height' => NULL),
+        'arguments' => array('path' => NULL, 'width' => NULL, 'height' => NULL, 'wid' => NULL),
         'path' => drupal_get_path('module', 'web_widgets') .'/google_gadgets',
       ),
       // Possible wrapper code around the widget
Index: iframe/web_widgets_style_iframe.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/web_widgets/iframe/web_widgets_style_iframe.inc,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 web_widgets_style_iframe.inc
--- iframe/web_widgets_style_iframe.inc	19 Feb 2010 19:56:12 -0000	1.1.2.1
+++ iframe/web_widgets_style_iframe.inc	15 Jun 2010 20:05:28 -0000
@@ -14,7 +14,7 @@ function web_widgets_style_iframe() {
       // The HTML-Javascript code lines what should be pasted into the external site
       'web_widgets_iframe' => array(
         'template' => 'web_widgets_iframe',
-        'arguments' => array('path' => NULL, 'width' => NULL, 'height' => NULL),
+        'arguments' => array('path' => NULL, 'width' => NULL, 'height' => NULL, 'wid' => NULL),
         'path' => drupal_get_path('module', 'web_widgets') .'/iframe',
       ),
       // The html page which is used inside the iframe, usually will show up on an external site
@@ -33,9 +33,10 @@ function web_widgets_style_iframe() {
  * Process variables for web_widgets_iframe.tpl.php
  */
 function template_preprocess_web_widgets_iframe(&$variables) {
-  static $id = 0;
-  $variables['wid'] = 'web_widget_iframe_'. $id++;
-
+  if (empty($variables['wid'])) {
+    static $id = 0;
+    $variables['wid'] = 'web_widget_iframe_'. $id++;
+  }
   // Create Javascript variables
   $widgetcontext = new stdClass();
   $widgetcontext->url = $variables['path'];
Index: inline/web_widgets_style_inline.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/web_widgets/inline/web_widgets_style_inline.inc,v
retrieving revision 1.1
diff -u -p -r1.1 web_widgets_style_inline.inc
--- inline/web_widgets_style_inline.inc	24 Jun 2009 07:38:58 -0000	1.1
+++ inline/web_widgets_style_inline.inc	15 Jun 2010 20:05:28 -0000
@@ -16,7 +16,7 @@ function web_widgets_style_inline() {
       // The HTML-Javascript code lines what should be pasted into the external site
       'web_widgets_inline' => array(
         'template' => 'web_widgets_inline',
-        'arguments' => array('path' => NULL, 'width' => NULL, 'height' => NULL),
+        'arguments' => array('path' => NULL, 'width' => NULL, 'height' => NULL, 'wid' => NULL),
         'path' => drupal_get_path('module', 'web_widgets') .'/inline',
       ),
       // Possible wrapper code around the widget
@@ -35,9 +35,11 @@ function web_widgets_style_inline() {
  * Process variables for web_widgets_inline.tpl.php
  */
 function template_preprocess_web_widgets_inline(&$variables) {
-  static $id = 0;
-  $variables['wid'] = 'web_widgets_inline_'. $id++;
-
+  if (empty($variables['wid'])) {
+    static $id = 0;
+    $variables['wid'] = 'web_widgets_inline_'. $id++;
+  }
+  
   // Create Javascript variables
   $widgetcontext = new stdClass();
   $widgetcontext->widgetid = $variables['wid'];
Index: uwa/web_widgets_style_uwa.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/web_widgets/uwa/web_widgets_style_uwa.inc,v
retrieving revision 1.1
diff -u -p -r1.1 web_widgets_style_uwa.inc
--- uwa/web_widgets_style_uwa.inc	24 Jun 2009 07:38:58 -0000	1.1
+++ uwa/web_widgets_style_uwa.inc	15 Jun 2010 20:05:28 -0000
@@ -16,7 +16,7 @@ function web_widgets_style_uwa() {
     'theme' => array(
       'web_widgets_uwa' => array(
         'template' => 'web_widgets_uwa',
-        'arguments' => array('path' => NULL, 'width' => NULL, 'height' => NULL),
+        'arguments' => array('path' => NULL, 'width' => NULL, 'height' => NULL, 'wid' => NULL),
         'path' => drupal_get_path('module', 'web_widgets') .'/uwa',
       ),
       // Possible wrapper code around the widget
@@ -58,9 +58,10 @@ function web_widgets_uwa_render($view) {
  * Process variables for web_widgets_uwa.tpl.php
  */
 function template_preprocess_web_widgets_uwa(&$variables) {
-  static $id = 0;
-  $variables['wid'] = 'web_widgets_uwa_'. $id++;
-
+  if (empty($variables['wid'])) {
+    static $id = 0;
+    $variables['wid'] = 'web_widgets_uwa_'. $id++;
+  }
   $views_path_html = $variables['path'] .'/uwa';
   $variables['url'] = $views_path_html;
 }
Index: views/web_widgets_plugin_display_web_widgets.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/web_widgets/views/web_widgets_plugin_display_web_widgets.inc,v
retrieving revision 1.1.2.4
diff -u -p -r1.1.2.4 web_widgets_plugin_display_web_widgets.inc
--- views/web_widgets_plugin_display_web_widgets.inc	15 Jun 2010 19:30:25 -0000	1.1.2.4
+++ views/web_widgets_plugin_display_web_widgets.inc	15 Jun 2010 20:05:28 -0000
@@ -239,7 +239,8 @@ class web_widgets_plugin_display_web_wid
       $path = url($this->view->get_url(NULL, $this->get_path()), array('absolute' => TRUE));
       $width = $this->get_option('width');
       $height = $this->get_option('height');
-      $this->view->attachment_after .= web_widgets_render_embed_code($current_style, $path, $width, $height);
+      $wid = strtr($this->view->name . '-' . $this->view->current_display, '_', '-');
+      $this->view->attachment_after .= web_widgets_render_embed_code($current_style, $path, $width, $height, $wid);    
     }
   }
 
