Commits

Sherif Mansour committed 55dcb63

Version 1.2 - doesn't load iframe on every page, added ajax spinner

Comments (0)

Files changed (5)

     <modelVersion>4.0.0</modelVersion>
     <groupId>com.atlassian.labs.sherif</groupId>
     <artifactId>confluence-eap-feedback</artifactId>
-    <version>1.1</version>
+    <version>1.2</version>
 
     <organization>
         <name>Atlassian</name>

src/main/resources/atlassian-plugin.xml

 <atlassian-plugin key="com.atlassian.labs.sherif.confluence-eap-feedback" name="Confluence EAP Feedback Plugin" plugins-version="2">
   <plugin-info>
     <description>Provide quick and easy feedback for a Confluence EAP release</description>
-    <version>1.1</version>
+    <version>1.2</version>
     <vendor name="sherif" url="http://www.atlassian.com/"/>
     <description/>
   </plugin-info>

src/main/resources/css/confluence-feedback.css

 	text-indent: -99999px;
 }
 
+.feedback_iframe {
+	background-image: url('../../download/resources/com.atlassian.labs.sherif.confluence-eap-feedback:annotate/images/ajax-loader.gif'); 
+	background-position:center; 
+	background-repeat: no-repeat;
+	no-repeat;
+	width:100%;
+	border: none;
+}
+
 .feedback_icon:hover {
 	background-position: 0 0;
 }

src/main/resources/images/ajax-loader.gif

Added
New image

src/main/resources/js/confluence-feedback.js

 	//Build final URL
 	var wufooExtraParams = 'def/field8='+userFullName+'&field15='+browser+'&field17='+currentUrl;		
 	var finalWufooUrl = wufooBaseUrl+wufooExtraParams;
-
-    var wufoo = "<iframe id='wufoo' height='415' allowTransparency='true' frameborder='0' scrolling='no' style='width:100%;border:none' src='"+finalWufooUrl+"'><a href='"+finalWufooUrl+"' title='Confluence EAP Feedback' rel='nofollow'>Provide Confluence EAP Feedback</a></iframe>";
+	console.log('EAP Feedback URL: '+finalWufooUrl);
+    var wufoo = "<iframe id='wufoo' height='415' allowTransparency='true' frameborder='0' scrolling='no' class='feedback_iframe' src='"+finalWufooUrl+"'><a href='"+finalWufooUrl+"' title='Confluence EAP Feedback' rel='nofollow'>Provide Confluence EAP Feedback</a></iframe>";
 
     jQuery('.ajs-menu-item:first').before("<li class='normal ajs-menu-item'><a id='feedback-menu-link' class='ajs-menu-title' href='#'><span id='feedback_icon' class='feedback_icon'>Provide feedback to Atlassian</span></a>&nbsp;&nbsp;</li>");
 
   	//Feedback dialog
-    var popup = new AJS.Dialog(860, 530);
-    popup.addHeader("Confluence EAP Feedback");
-    popup.addPanel("Panel 1", wufoo, "panel-body");
-    popup.addLink("Close", function (dialog) {
-      dialog.hide();
-    });
+    var popup;
    
     AJS.$("#feedback-menu-link").click(function() {
+		if (!popup) {
+			popup = new AJS.Dialog(860, 530);
+		    popup.addHeader("Confluence EAP Feedback");
+		    popup.addPanel("Panel 1", wufoo, "panel-body");
+		    popup.addLink("Close", function (dialog) {
+		      dialog.hide();
+		    });
+		}
         popup.show();
     });