1. Atlassian Tutorials
  2. Untitled project
  3. Confluence Status Light Macro

Commits

Ben Woskow [Atlassian]  committed 0a69cd7

updating the tutorial code to compile

  • Participants
  • Parent commits cf98763
  • Branches default

Comments (0)

Files changed (2)

File src/main/java/com/atlassian/confluence/plugin/StatusLightMacro.java

View file
 package com.atlassian.confluence.plugin;
 
 import com.atlassian.confluence.content.render.xhtml.ConversionContext;
+import com.atlassian.confluence.macro.DefaultImagePlaceholder;
 import com.atlassian.confluence.macro.EditorImagePlaceholder;
+import com.atlassian.confluence.macro.ImagePlaceholder;
 import com.atlassian.confluence.macro.Macro;
 import com.atlassian.confluence.macro.MacroExecutionException;
 import com.atlassian.confluence.macro.ResourceAware;
+import com.atlassian.confluence.pages.thumbnail.Dimensions;
 import com.atlassian.confluence.setup.settings.SettingsManager;
 import org.apache.commons.lang.StringUtils;
 
     }
 
     public void setResourcePath(String s) {}
+
+    public ImagePlaceholder getImagePlaceholder(Map<String, String> params, ConversionContext ctx)
+    {
+        // Each image placeholder is a 200x18 image
+        return new DefaultImagePlaceholder(getImageLocation(params, ctx), new Dimensions(200, 18), false);
+    }
 }

File src/main/resources/atlassian-plugin.xml

View file
     </resource>
 
     <web-resource name="Javascript" key="editor_status-light">
+        <dependency>com.atlassian.confluence.tinymceplugin:editor-resources</dependency>
         <resource type="download" name="status-light.js" location="js/status-light.js"/>
         <context>editor</context>
     </web-resource>